
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/functions/elementary.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:28:15 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Elementary &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/doctools.js"></script>
    <script src="../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../live.sympy.org/static/live-sphinx.js"></script>
    <script async="async" src="../../../../cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest8331.js?config=TeX-AMS_HTML-full"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]]}})</script>
    
    <link rel="shortcut icon" href="../../_static/sympy-notailtext-favicon.ico"/>
    <link href="elementary.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Combinatorial" href="combinatorial.html" />
    <link rel="prev" title="Functions" href="index.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="combinatorial.html" title="Combinatorial"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Functions"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Functions</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Elementary</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="elementary">
<h1>Elementary<a class="headerlink" href="#elementary" title="Permalink to this headline">¶</a></h1>
<p>This module implements elementary functions such as trigonometric, hyperbolic, and
sqrt, as well as functions like <code class="docutils literal notranslate"><span class="pre">Abs</span></code>, <code class="docutils literal notranslate"><span class="pre">Max</span></code>, <code class="docutils literal notranslate"><span class="pre">Min</span></code> etc.</p>
</section>
<section id="sympy-functions-elementary-complexes">
<h1>sympy.functions.elementary.complexes<a class="headerlink" href="#sympy-functions-elementary-complexes" title="Permalink to this headline">¶</a></h1>
<section id="re">
<h2>re<a class="headerlink" href="#re" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.complexes.re">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.complexes.</span></span><span class="sig-name descname"><span class="pre">re</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/complexes.py#L20-L137"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.complexes.re" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns real part of expression. This function performs only
elementary analysis and so it will fail to decompose properly
more complicated expressions. If completely simplified result
is needed then use Basic.as_real_imag() or perform complex
expansion on instance of this function.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>arg</strong> : Expr</p>
<blockquote>
<div><p>Real or complex expression.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>expr</strong> : Expr</p>
<blockquote>
<div><p>Real part of expression.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">re</span><span class="p">,</span> <span class="n">im</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x y&#39;</span><span class="p">,</span> <span class="n">real</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">re</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">E</span><span class="p">)</span>
<span class="go">2*E</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">re</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">I</span> <span class="o">+</span> <span class="mi">17</span><span class="p">)</span>
<span class="go">17</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">re</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">I</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">re</span><span class="p">(</span><span class="n">im</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">+</span> <span class="n">x</span><span class="o">*</span><span class="n">I</span> <span class="o">+</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">re</span><span class="p">(</span><span class="mi">5</span> <span class="o">+</span> <span class="n">I</span> <span class="o">+</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">7</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.complexes.im" title="sympy.functions.elementary.complexes.im"><code class="xref py py-obj docutils literal notranslate"><span class="pre">im</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.complexes.re.as_real_imag">
<span class="sig-name descname"><span class="pre">as_real_imag</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">deep</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/complexes.py#L107-L112"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.complexes.re.as_real_imag" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the real number with a zero imaginary part.</p>
</dd></dl>

</dd></dl>

</section>
<section id="im">
<h2>im<a class="headerlink" href="#im" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.complexes.im">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.complexes.</span></span><span class="sig-name descname"><span class="pre">im</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/complexes.py#L140-L255"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.complexes.im" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns imaginary part of expression. This function performs only
elementary analysis and so it will fail to decompose properly more
complicated expressions. If completely simplified result is needed then
use Basic.as_real_imag() or perform complex expansion on instance of
this function.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>arg</strong> : Expr</p>
<blockquote>
<div><p>Real or complex expression.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>expr</strong> : Expr</p>
<blockquote>
<div><p>Imaginary part of expression.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">re</span><span class="p">,</span> <span class="n">im</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">im</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">E</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">im</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">I</span> <span class="o">+</span> <span class="mi">17</span><span class="p">)</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">im</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">I</span><span class="p">)</span>
<span class="go">re(x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">im</span><span class="p">(</span><span class="n">re</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">+</span> <span class="n">y</span><span class="p">)</span>
<span class="go">im(y)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">im</span><span class="p">(</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">I</span><span class="p">)</span>
<span class="go">3</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.complexes.re" title="sympy.functions.elementary.complexes.re"><code class="xref py py-obj docutils literal notranslate"><span class="pre">re</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.complexes.im.as_real_imag">
<span class="sig-name descname"><span class="pre">as_real_imag</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">deep</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/complexes.py#L226-L231"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.complexes.im.as_real_imag" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the imaginary part with a zero real part.</p>
</dd></dl>

</dd></dl>

</section>
<section id="sign">
<h2>sign<a class="headerlink" href="#sign" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.complexes.sign">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.complexes.</span></span><span class="sig-name descname"><span class="pre">sign</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/complexes.py#L261-L440"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.complexes.sign" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the complex sign of an expression:</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>arg</strong> : Expr</p>
<blockquote>
<div><p>Real or imaginary expression.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>expr</strong> : Expr</p>
<blockquote>
<div><p>Complex sign of expression.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>If the expression is real the sign will be:</p>
<blockquote>
<div><ul class="simple">
<li><p>1 if expression is positive</p></li>
<li><p>0 if expression is equal to zero</p></li>
<li><p>-1 if expression is negative</p></li>
</ul>
</div></blockquote>
<p>If the expression is imaginary the sign will be:</p>
<blockquote>
<div><ul class="simple">
<li><p>I if im(expression) is positive</p></li>
<li><p>-I if im(expression) is negative</p></li>
</ul>
</div></blockquote>
<p>Otherwise an unevaluated expression will be returned. When evaluated, the
result (in general) will be <code class="docutils literal notranslate"><span class="pre">cos(arg(expr))</span> <span class="pre">+</span> <span class="pre">I*sin(arg(expr))</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions</span> <span class="kn">import</span> <span class="n">sign</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.core.numbers</span> <span class="kn">import</span> <span class="n">I</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">sign</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">-1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sign</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sign</span><span class="p">(</span><span class="o">-</span><span class="mi">3</span><span class="o">*</span><span class="n">I</span><span class="p">)</span>
<span class="go">-I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sign</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">I</span><span class="p">)</span>
<span class="go">sign(1 + I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="o">.</span><span class="n">evalf</span><span class="p">()</span>
<span class="go">0.707106781186548 + 0.707106781186548*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.complexes.Abs" title="sympy.functions.elementary.complexes.Abs"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Abs</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.complexes.conjugate" title="sympy.functions.elementary.complexes.conjugate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">conjugate</span></code></a></p>
</div>
</dd></dl>

</section>
<section id="abs">
<h2>Abs<a class="headerlink" href="#abs" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.complexes.Abs">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.complexes.</span></span><span class="sig-name descname"><span class="pre">Abs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/complexes.py#L443-L689"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.complexes.Abs" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the absolute value of the argument.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>arg</strong> : Expr</p>
<blockquote>
<div><p>Real or complex expression.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>expr</strong> : Expr</p>
<blockquote>
<div><p>Absolute value returned can be an expression or integer depending on
input arg.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>This is an extension of the built-in function abs() to accept symbolic
values.  If you pass a SymPy expression to the built-in abs(), it will
pass it automatically to Abs().</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Abs</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">S</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Abs</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">,</span> <span class="n">real</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Abs</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="p">)</span>
<span class="go">Abs(x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Abs</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="go">x**2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">abs</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="p">)</span> <span class="c1"># The Python built-in</span>
<span class="go">Abs(x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Abs</span><span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="n">x</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">I</span><span class="p">)</span>
<span class="go">sqrt(9*x**2 + 4)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Abs</span><span class="p">(</span><span class="mi">8</span><span class="o">*</span><span class="n">I</span><span class="p">)</span>
<span class="go">8</span>
</pre></div>
</div>
<p>Note that the Python built-in will return either an Expr or int depending on
the argument:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="nb">abs</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">))</span>
<span class="go">&lt;... &#39;int&#39;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="nb">abs</span><span class="p">(</span><span class="n">S</span><span class="o">.</span><span class="n">NegativeOne</span><span class="p">))</span>
<span class="go">&lt;class &#39;sympy.core.numbers.One&#39;&gt;</span>
</pre></div>
</div>
<p>Abs will always return a sympy object.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.complexes.sign" title="sympy.functions.elementary.complexes.sign"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sign</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.complexes.conjugate" title="sympy.functions.elementary.complexes.conjugate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">conjugate</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.complexes.Abs.fdiff">
<span class="sig-name descname"><span class="pre">fdiff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/complexes.py#L507-L515"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.complexes.Abs.fdiff" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the first derivative of the argument to Abs().</p>
</dd></dl>

</dd></dl>

</section>
<section id="arg">
<h2>arg<a class="headerlink" href="#arg" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.complexes.arg">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.complexes.</span></span><span class="sig-name descname"><span class="pre">arg</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/complexes.py#L692-L764"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.complexes.arg" title="Permalink to this definition">¶</a></dt>
<dd><p>returns the argument (in radians) of a complex number.  The argument is
evaluated in consistent convention with atan2 where the branch-cut is
taken along the negative real axis and arg(z) is in the interval
(-pi,pi].  For a positive number, the argument is always 0.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>arg</strong> : Expr</p>
<blockquote>
<div><p>Real or complex expression.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>value</strong> : Expr</p>
<blockquote>
<div><p>Returns arc tangent of arg measured in radians.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions</span> <span class="kn">import</span> <span class="n">arg</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">I</span><span class="p">,</span> <span class="n">sqrt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">arg</span><span class="p">(</span><span class="mf">2.0</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">arg</span><span class="p">(</span><span class="n">I</span><span class="p">)</span>
<span class="go">pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">arg</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="o">+</span> <span class="n">I</span><span class="o">*</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">pi/4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">arg</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span> <span class="o">+</span> <span class="n">I</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span>
<span class="go">pi/6</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">arg</span><span class="p">(</span><span class="mi">4</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">I</span><span class="p">)</span>
<span class="go">atan(3/4)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">arg</span><span class="p">(</span><span class="mf">0.8</span> <span class="o">+</span> <span class="mf">0.6</span><span class="o">*</span><span class="n">I</span><span class="p">)</span>
<span class="go">0.643501108793284</span>
</pre></div>
</div>
</dd></dl>

</section>
<section id="conjugate">
<h2>conjugate<a class="headerlink" href="#conjugate" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.complexes.conjugate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.complexes.</span></span><span class="sig-name descname"><span class="pre">conjugate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/complexes.py#L767-L838"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.complexes.conjugate" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the <span class="math notranslate nohighlight">\(complex conjugate\)</span> Ref[1] of an argument.
In mathematics, the complex conjugate of a complex number
is given by changing the sign of the imaginary part.</p>
<p>Thus, the conjugate of the complex number
<span class="math notranslate nohighlight">\(a + ib\)</span> (where a and b are real numbers) is <span class="math notranslate nohighlight">\(a - ib\)</span></p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>arg</strong> : Expr</p>
<blockquote>
<div><p>Real or complex expression.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>arg</strong> : Expr</p>
<blockquote>
<div><p>Complex conjugate of arg as real, imaginary or mixed expression.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">conjugate</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">I</span><span class="p">)</span>
<span class="go">-I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">I</span><span class="p">)</span>
<span class="go">3 - 2*I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="mi">5</span> <span class="o">-</span> <span class="n">I</span><span class="p">)</span>
<span class="go">5 + I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.complexes.sign" title="sympy.functions.elementary.complexes.sign"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sign</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.complexes.Abs" title="sympy.functions.elementary.complexes.Abs"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Abs</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r225"><span class="brackets"><a class="fn-backref" href="#id1">R225</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Complex_conjugation">https://en.wikipedia.org/wiki/Complex_conjugation</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="polar-lift">
<h2>polar_lift<a class="headerlink" href="#polar-lift" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.complexes.polar_lift">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.complexes.</span></span><span class="sig-name descname"><span class="pre">polar_lift</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/complexes.py#L967-L1047"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.complexes.polar_lift" title="Permalink to this definition">¶</a></dt>
<dd><p>Lift argument to the Riemann surface of the logarithm, using the
standard branch.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>arg</strong> : Expr</p>
<blockquote>
<div><p>Real or complex expression.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">polar_lift</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;p&#39;</span><span class="p">,</span> <span class="n">polar</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polar_lift</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
<span class="go">4*exp_polar(0)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polar_lift</span><span class="p">(</span><span class="o">-</span><span class="mi">4</span><span class="p">)</span>
<span class="go">4*exp_polar(I*pi)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polar_lift</span><span class="p">(</span><span class="o">-</span><span class="n">I</span><span class="p">)</span>
<span class="go">exp_polar(-I*pi/2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polar_lift</span><span class="p">(</span><span class="n">I</span> <span class="o">+</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">polar_lift(2 + I)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">polar_lift</span><span class="p">(</span><span class="mi">4</span><span class="o">*</span><span class="n">x</span><span class="p">)</span>
<span class="go">4*polar_lift(x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polar_lift</span><span class="p">(</span><span class="mi">4</span><span class="o">*</span><span class="n">p</span><span class="p">)</span>
<span class="go">4*p</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.exponential.exp_polar" title="sympy.functions.elementary.exponential.exp_polar"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.functions.elementary.exponential.exp_polar</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.complexes.periodic_argument" title="sympy.functions.elementary.complexes.periodic_argument"><code class="xref py py-obj docutils literal notranslate"><span class="pre">periodic_argument</span></code></a></p>
</div>
</dd></dl>

</section>
<section id="periodic-argument">
<h2>periodic_argument<a class="headerlink" href="#periodic-argument" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.complexes.periodic_argument">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.complexes.</span></span><span class="sig-name descname"><span class="pre">periodic_argument</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ar</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">period</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/complexes.py#L1050-L1149"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.complexes.periodic_argument" title="Permalink to this definition">¶</a></dt>
<dd><p>Represent the argument on a quotient of the Riemann surface of the
logarithm. That is, given a period <span class="math notranslate nohighlight">\(P\)</span>, always return a value in
(-P/2, P/2], by using exp(P*I) == 1.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>ar</strong> : Expr</p>
<blockquote>
<div><p>A polar number.</p>
</div></blockquote>
<p><strong>period</strong> : ExprT</p>
<blockquote>
<div><p>The period <span class="math notranslate nohighlight">\(P\)</span>.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp_polar</span><span class="p">,</span> <span class="n">periodic_argument</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">I</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">periodic_argument</span><span class="p">(</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">10</span><span class="o">*</span><span class="n">I</span><span class="o">*</span><span class="n">pi</span><span class="p">),</span> <span class="mi">2</span><span class="o">*</span><span class="n">pi</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">periodic_argument</span><span class="p">(</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">I</span><span class="o">*</span><span class="n">pi</span><span class="p">),</span> <span class="mi">4</span><span class="o">*</span><span class="n">pi</span><span class="p">)</span>
<span class="go">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp_polar</span><span class="p">,</span> <span class="n">periodic_argument</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">I</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">periodic_argument</span><span class="p">(</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">I</span><span class="o">*</span><span class="n">pi</span><span class="p">),</span> <span class="mi">2</span><span class="o">*</span><span class="n">pi</span><span class="p">)</span>
<span class="go">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">periodic_argument</span><span class="p">(</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">I</span><span class="o">*</span><span class="n">pi</span><span class="p">),</span> <span class="mi">3</span><span class="o">*</span><span class="n">pi</span><span class="p">)</span>
<span class="go">-pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">periodic_argument</span><span class="p">(</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">I</span><span class="o">*</span><span class="n">pi</span><span class="p">),</span> <span class="n">pi</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.exponential.exp_polar" title="sympy.functions.elementary.exponential.exp_polar"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.functions.elementary.exponential.exp_polar</span></code></a></p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.elementary.complexes.polar_lift" title="sympy.functions.elementary.complexes.polar_lift"><code class="xref py py-obj docutils literal notranslate"><span class="pre">polar_lift</span></code></a></dt><dd><p>Lift argument to the Riemann surface of the logarithm</p>
</dd>
</dl>
<p><a class="reference internal" href="#sympy.functions.elementary.complexes.principal_branch" title="sympy.functions.elementary.complexes.principal_branch"><code class="xref py py-obj docutils literal notranslate"><span class="pre">principal_branch</span></code></a></p>
</div>
</dd></dl>

</section>
<section id="principal-branch">
<h2>principal_branch<a class="headerlink" href="#principal-branch" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.complexes.principal_branch">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.complexes.</span></span><span class="sig-name descname"><span class="pre">principal_branch</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">period</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/complexes.py#L1174-L1276"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.complexes.principal_branch" title="Permalink to this definition">¶</a></dt>
<dd><p>Represent a polar number reduced to its principal branch on a quotient
of the Riemann surface of the logarithm.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> : Expr</p>
<blockquote>
<div><p>A polar number.</p>
</div></blockquote>
<p><strong>period</strong> : Expr</p>
<blockquote>
<div><p>Positive real number or infinity.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>This is a function of two arguments. The first argument is a polar
number <span class="math notranslate nohighlight">\(z\)</span>, and the second one a positive real number or infinity, <span class="math notranslate nohighlight">\(p\)</span>.
The result is “z mod exp_polar(I*p)”.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp_polar</span><span class="p">,</span> <span class="n">principal_branch</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">principal_branch</span><span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">oo</span><span class="p">)</span>
<span class="go">z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">principal_branch</span><span class="p">(</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">pi</span><span class="o">*</span><span class="n">I</span><span class="p">)</span><span class="o">*</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="o">*</span><span class="n">pi</span><span class="p">)</span>
<span class="go">3*exp_polar(0)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">principal_branch</span><span class="p">(</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">pi</span><span class="o">*</span><span class="n">I</span><span class="p">)</span><span class="o">*</span><span class="mi">3</span><span class="o">*</span><span class="n">z</span><span class="p">,</span> <span class="mi">2</span><span class="o">*</span><span class="n">pi</span><span class="p">)</span>
<span class="go">3*principal_branch(z, 2*pi)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.exponential.exp_polar" title="sympy.functions.elementary.exponential.exp_polar"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.functions.elementary.exponential.exp_polar</span></code></a></p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.elementary.complexes.polar_lift" title="sympy.functions.elementary.complexes.polar_lift"><code class="xref py py-obj docutils literal notranslate"><span class="pre">polar_lift</span></code></a></dt><dd><p>Lift argument to the Riemann surface of the logarithm</p>
</dd>
</dl>
<p><a class="reference internal" href="#sympy.functions.elementary.complexes.periodic_argument" title="sympy.functions.elementary.complexes.periodic_argument"><code class="xref py py-obj docutils literal notranslate"><span class="pre">periodic_argument</span></code></a></p>
</div>
</dd></dl>

</section>
</section>
<section id="sympy-functions-elementary-trigonometric">
<h1>sympy.functions.elementary.trigonometric<a class="headerlink" href="#sympy-functions-elementary-trigonometric" title="Permalink to this headline">¶</a></h1>
</section>
<section id="trigonometric-functions">
<span id="trionometric-functions"></span><h1>Trigonometric Functions<a class="headerlink" href="#trigonometric-functions" title="Permalink to this headline">¶</a></h1>
<section id="sin">
<h2>sin<a class="headerlink" href="#sin" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.sin">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.trigonometric.</span></span><span class="sig-name descname"><span class="pre">sin</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L209-L512"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.sin" title="Permalink to this definition">¶</a></dt>
<dd><p>The sine function.</p>
<p>Returns the sine of x (measured in radians).</p>
<p class="rubric">Explanation</p>
<p>This function will evaluate automatically in the
case x/pi is some rational number <a class="reference internal" href="#r229" id="id2"><span>[R229]</span></a>.  For example,
if x is a multiple of pi, pi/2, pi/3, pi/4 and pi/6.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sin</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2*x*cos(x**2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sin</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sin</span><span class="p">(</span><span class="n">pi</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sin</span><span class="p">(</span><span class="n">pi</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sin</span><span class="p">(</span><span class="n">pi</span><span class="o">/</span><span class="mi">6</span><span class="p">)</span>
<span class="go">1/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sin</span><span class="p">(</span><span class="n">pi</span><span class="o">/</span><span class="mi">12</span><span class="p">)</span>
<span class="go">-sqrt(2)/4 + sqrt(6)/4</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.trigonometric.csc" title="sympy.functions.elementary.trigonometric.csc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">csc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cos" title="sympy.functions.elementary.trigonometric.cos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sec" title="sympy.functions.elementary.trigonometric.sec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.tan" title="sympy.functions.elementary.trigonometric.tan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cot" title="sympy.functions.elementary.trigonometric.cot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asin" title="sympy.functions.elementary.trigonometric.asin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acsc" title="sympy.functions.elementary.trigonometric.acsc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acsc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acos" title="sympy.functions.elementary.trigonometric.acos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asec" title="sympy.functions.elementary.trigonometric.asec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan" title="sympy.functions.elementary.trigonometric.atan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acot" title="sympy.functions.elementary.trigonometric.acot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan2" title="sympy.functions.elementary.trigonometric.atan2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan2</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r226"><span class="brackets"><a class="fn-backref" href="#id3">R226</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Trigonometric_functions">https://en.wikipedia.org/wiki/Trigonometric_functions</a></p>
</dd>
<dt class="label" id="r227"><span class="brackets"><a class="fn-backref" href="#id4">R227</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/4.14">http://dlmf.nist.gov/4.14</a></p>
</dd>
<dt class="label" id="r228"><span class="brackets"><a class="fn-backref" href="#id5">R228</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/Sin">http://functions.wolfram.com/ElementaryFunctions/Sin</a></p>
</dd>
<dt class="label" id="r229"><span class="brackets">R229</span><span class="fn-backref">(<a href="#id2">1</a>,<a href="#id6">2</a>)</span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/TrigonometryAngles.html">http://mathworld.wolfram.com/TrigonometryAngles.html</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="cos">
<h2>cos<a class="headerlink" href="#cos" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.cos">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.trigonometric.</span></span><span class="sig-name descname"><span class="pre">cos</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L515-L965"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.cos" title="Permalink to this definition">¶</a></dt>
<dd><p>The cosine function.</p>
<p>Returns the cosine of x (measured in radians).</p>
<p class="rubric">Explanation</p>
<p>See <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-func docutils literal notranslate"><span class="pre">sin()</span></code></a> for notes about automatic evaluation.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">cos</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cos</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">-2*x*sin(x**2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cos</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cos</span><span class="p">(</span><span class="n">pi</span><span class="p">)</span>
<span class="go">-1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cos</span><span class="p">(</span><span class="n">pi</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cos</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">pi</span><span class="o">/</span><span class="mi">3</span><span class="p">)</span>
<span class="go">-1/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cos</span><span class="p">(</span><span class="n">pi</span><span class="o">/</span><span class="mi">12</span><span class="p">)</span>
<span class="go">sqrt(2)/4 + sqrt(6)/4</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.csc" title="sympy.functions.elementary.trigonometric.csc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">csc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sec" title="sympy.functions.elementary.trigonometric.sec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.tan" title="sympy.functions.elementary.trigonometric.tan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cot" title="sympy.functions.elementary.trigonometric.cot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asin" title="sympy.functions.elementary.trigonometric.asin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acsc" title="sympy.functions.elementary.trigonometric.acsc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acsc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acos" title="sympy.functions.elementary.trigonometric.acos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asec" title="sympy.functions.elementary.trigonometric.asec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan" title="sympy.functions.elementary.trigonometric.atan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acot" title="sympy.functions.elementary.trigonometric.acot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan2" title="sympy.functions.elementary.trigonometric.atan2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan2</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r230"><span class="brackets"><a class="fn-backref" href="#id7">R230</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Trigonometric_functions">https://en.wikipedia.org/wiki/Trigonometric_functions</a></p>
</dd>
<dt class="label" id="r231"><span class="brackets"><a class="fn-backref" href="#id8">R231</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/4.14">http://dlmf.nist.gov/4.14</a></p>
</dd>
<dt class="label" id="r232"><span class="brackets"><a class="fn-backref" href="#id9">R232</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/Cos">http://functions.wolfram.com/ElementaryFunctions/Cos</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="tan">
<h2>tan<a class="headerlink" href="#tan" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.tan">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.trigonometric.</span></span><span class="sig-name descname"><span class="pre">tan</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L968-L1301"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.tan" title="Permalink to this definition">¶</a></dt>
<dd><p>The tangent function.</p>
<p>Returns the tangent of x (measured in radians).</p>
<p class="rubric">Explanation</p>
<p>See <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-func docutils literal notranslate"><span class="pre">sin()</span></code></a> for notes about automatic evaluation.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">tan</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tan</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2*x*(tan(x**2)**2 + 1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tan</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tan</span><span class="p">(</span><span class="n">pi</span><span class="o">/</span><span class="mi">8</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">()</span>
<span class="go">-1 + sqrt(2)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.csc" title="sympy.functions.elementary.trigonometric.csc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">csc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cos" title="sympy.functions.elementary.trigonometric.cos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sec" title="sympy.functions.elementary.trigonometric.sec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cot" title="sympy.functions.elementary.trigonometric.cot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asin" title="sympy.functions.elementary.trigonometric.asin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acsc" title="sympy.functions.elementary.trigonometric.acsc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acsc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acos" title="sympy.functions.elementary.trigonometric.acos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asec" title="sympy.functions.elementary.trigonometric.asec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan" title="sympy.functions.elementary.trigonometric.atan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acot" title="sympy.functions.elementary.trigonometric.acot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan2" title="sympy.functions.elementary.trigonometric.atan2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan2</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r233"><span class="brackets"><a class="fn-backref" href="#id10">R233</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Trigonometric_functions">https://en.wikipedia.org/wiki/Trigonometric_functions</a></p>
</dd>
<dt class="label" id="r234"><span class="brackets"><a class="fn-backref" href="#id11">R234</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/4.14">http://dlmf.nist.gov/4.14</a></p>
</dd>
<dt class="label" id="r235"><span class="brackets"><a class="fn-backref" href="#id12">R235</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/Tan">http://functions.wolfram.com/ElementaryFunctions/Tan</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.tan.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L1015-L1019"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.tan.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="cot">
<h2>cot<a class="headerlink" href="#cot" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.cot">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.trigonometric.</span></span><span class="sig-name descname"><span class="pre">cot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L1304-L1609"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.cot" title="Permalink to this definition">¶</a></dt>
<dd><p>The cotangent function.</p>
<p>Returns the cotangent of x (measured in radians).</p>
<p class="rubric">Explanation</p>
<p>See <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-func docutils literal notranslate"><span class="pre">sin()</span></code></a> for notes about automatic evaluation.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">cot</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cot</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2*x*(-cot(x**2)**2 - 1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cot</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cot</span><span class="p">(</span><span class="n">pi</span><span class="o">/</span><span class="mi">12</span><span class="p">)</span>
<span class="go">sqrt(3) + 2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.csc" title="sympy.functions.elementary.trigonometric.csc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">csc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cos" title="sympy.functions.elementary.trigonometric.cos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sec" title="sympy.functions.elementary.trigonometric.sec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.tan" title="sympy.functions.elementary.trigonometric.tan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asin" title="sympy.functions.elementary.trigonometric.asin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acsc" title="sympy.functions.elementary.trigonometric.acsc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acsc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acos" title="sympy.functions.elementary.trigonometric.acos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asec" title="sympy.functions.elementary.trigonometric.asec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan" title="sympy.functions.elementary.trigonometric.atan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acot" title="sympy.functions.elementary.trigonometric.acot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan2" title="sympy.functions.elementary.trigonometric.atan2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan2</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r236"><span class="brackets"><a class="fn-backref" href="#id13">R236</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Trigonometric_functions">https://en.wikipedia.org/wiki/Trigonometric_functions</a></p>
</dd>
<dt class="label" id="r237"><span class="brackets"><a class="fn-backref" href="#id14">R237</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/4.14">http://dlmf.nist.gov/4.14</a></p>
</dd>
<dt class="label" id="r238"><span class="brackets"><a class="fn-backref" href="#id15">R238</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/Cot">http://functions.wolfram.com/ElementaryFunctions/Cot</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.cot.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L1351-L1355"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.cot.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="sec">
<h2>sec<a class="headerlink" href="#sec" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.sec">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.trigonometric.</span></span><span class="sig-name descname"><span class="pre">sec</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L1732-L1825"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.sec" title="Permalink to this definition">¶</a></dt>
<dd><p>The secant function.</p>
<p>Returns the secant of x (measured in radians).</p>
<p class="rubric">Explanation</p>
<p>See <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-func docutils literal notranslate"><span class="pre">sin()</span></code></a> for notes about automatic evaluation.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sec</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sec</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2*x*tan(x**2)*sec(x**2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sec</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.csc" title="sympy.functions.elementary.trigonometric.csc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">csc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cos" title="sympy.functions.elementary.trigonometric.cos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.tan" title="sympy.functions.elementary.trigonometric.tan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cot" title="sympy.functions.elementary.trigonometric.cot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asin" title="sympy.functions.elementary.trigonometric.asin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acsc" title="sympy.functions.elementary.trigonometric.acsc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acsc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acos" title="sympy.functions.elementary.trigonometric.acos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asec" title="sympy.functions.elementary.trigonometric.asec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan" title="sympy.functions.elementary.trigonometric.atan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acot" title="sympy.functions.elementary.trigonometric.acot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan2" title="sympy.functions.elementary.trigonometric.atan2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan2</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r239"><span class="brackets"><a class="fn-backref" href="#id16">R239</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Trigonometric_functions">https://en.wikipedia.org/wiki/Trigonometric_functions</a></p>
</dd>
<dt class="label" id="r240"><span class="brackets"><a class="fn-backref" href="#id17">R240</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/4.14">http://dlmf.nist.gov/4.14</a></p>
</dd>
<dt class="label" id="r241"><span class="brackets"><a class="fn-backref" href="#id18">R241</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/Sec">http://functions.wolfram.com/ElementaryFunctions/Sec</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="csc">
<h2>csc<a class="headerlink" href="#csc" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.csc">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.trigonometric.</span></span><span class="sig-name descname"><span class="pre">csc</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L1827-L1911"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.csc" title="Permalink to this definition">¶</a></dt>
<dd><p>The cosecant function.</p>
<p>Returns the cosecant of x (measured in radians).</p>
<p class="rubric">Explanation</p>
<p>See <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-func docutils literal notranslate"><span class="pre">sin()</span></code></a> for notes about automatic evaluation.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">csc</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">csc</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">-2*x*cot(x**2)*csc(x**2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">csc</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cos" title="sympy.functions.elementary.trigonometric.cos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sec" title="sympy.functions.elementary.trigonometric.sec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.tan" title="sympy.functions.elementary.trigonometric.tan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cot" title="sympy.functions.elementary.trigonometric.cot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asin" title="sympy.functions.elementary.trigonometric.asin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acsc" title="sympy.functions.elementary.trigonometric.acsc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acsc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acos" title="sympy.functions.elementary.trigonometric.acos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asec" title="sympy.functions.elementary.trigonometric.asec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan" title="sympy.functions.elementary.trigonometric.atan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acot" title="sympy.functions.elementary.trigonometric.acot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan2" title="sympy.functions.elementary.trigonometric.atan2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan2</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r242"><span class="brackets"><a class="fn-backref" href="#id19">R242</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Trigonometric_functions">https://en.wikipedia.org/wiki/Trigonometric_functions</a></p>
</dd>
<dt class="label" id="r243"><span class="brackets"><a class="fn-backref" href="#id20">R243</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/4.14">http://dlmf.nist.gov/4.14</a></p>
</dd>
<dt class="label" id="r244"><span class="brackets"><a class="fn-backref" href="#id21">R244</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/Csc">http://functions.wolfram.com/ElementaryFunctions/Csc</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="sinc">
<h2>sinc<a class="headerlink" href="#sinc" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.sinc">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.trigonometric.</span></span><span class="sig-name descname"><span class="pre">sinc</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L1914-L2015"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.sinc" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents an unnormalized sinc function:</p>
<div class="math notranslate nohighlight">
\[\begin{split}\operatorname{sinc}(x) =
\begin{cases}
  \frac{\sin x}{x} &amp; \qquad x \neq 0 \\
  1 &amp; \qquad x = 0
\end{cases}\end{split}\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sinc</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">jn</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sinc</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">sinc(x)</span>
</pre></div>
</div>
<ul class="simple">
<li><p>Automated Evaluation</p></li>
</ul>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">sinc</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sinc</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<ul class="simple">
<li><p>Differentiation</p></li>
</ul>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">sinc</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">()</span>
<span class="go">cos(x)/x - sin(x)/x**2</span>
</pre></div>
</div>
<ul class="simple">
<li><p>Series Expansion</p></li>
</ul>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">sinc</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">series</span><span class="p">()</span>
<span class="go">1 - x**2/6 + x**4/120 + O(x**6)</span>
</pre></div>
</div>
<ul class="simple">
<li><p>As zero’th order spherical Bessel Function</p></li>
</ul>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">sinc</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">jn</span><span class="p">)</span>
<span class="go">jn(0, x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sin</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r245"><span class="brackets"><a class="fn-backref" href="#id22">R245</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Sinc_function">https://en.wikipedia.org/wiki/Sinc_function</a></p>
</dd>
</dl>
</dd></dl>

</section>
</section>
<section id="trigonometric-inverses">
<h1>Trigonometric Inverses<a class="headerlink" href="#trigonometric-inverses" title="Permalink to this headline">¶</a></h1>
<section id="asin">
<h2>asin<a class="headerlink" href="#asin" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.asin">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.trigonometric.</span></span><span class="sig-name descname"><span class="pre">asin</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L2100-L2313"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.asin" title="Permalink to this definition">¶</a></dt>
<dd><p>The inverse sine function.</p>
<p>Returns the arcsine of x in radians.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">asin(x)</span></code> will evaluate automatically in the cases <code class="docutils literal notranslate"><span class="pre">oo</span></code>, <code class="docutils literal notranslate"><span class="pre">-oo</span></code>,
<code class="docutils literal notranslate"><span class="pre">0</span></code>, <code class="docutils literal notranslate"><span class="pre">1</span></code>, <code class="docutils literal notranslate"><span class="pre">-1</span></code> and for some instances when the result is a rational
multiple of pi (see the eval class method).</p>
<p>A purely imaginary argument will lead to an asinh expression.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">asin</span><span class="p">,</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asin</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asin</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">-pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asin</span><span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">)</span>
<span class="go">oo*I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asin</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">-oo*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.csc" title="sympy.functions.elementary.trigonometric.csc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">csc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cos" title="sympy.functions.elementary.trigonometric.cos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sec" title="sympy.functions.elementary.trigonometric.sec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.tan" title="sympy.functions.elementary.trigonometric.tan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cot" title="sympy.functions.elementary.trigonometric.cot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acsc" title="sympy.functions.elementary.trigonometric.acsc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acsc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acos" title="sympy.functions.elementary.trigonometric.acos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asec" title="sympy.functions.elementary.trigonometric.asec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan" title="sympy.functions.elementary.trigonometric.atan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acot" title="sympy.functions.elementary.trigonometric.acot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan2" title="sympy.functions.elementary.trigonometric.atan2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan2</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r246"><span class="brackets"><a class="fn-backref" href="#id23">R246</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Inverse_trigonometric_functions">https://en.wikipedia.org/wiki/Inverse_trigonometric_functions</a></p>
</dd>
<dt class="label" id="r247"><span class="brackets"><a class="fn-backref" href="#id24">R247</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/4.23">http://dlmf.nist.gov/4.23</a></p>
</dd>
<dt class="label" id="r248"><span class="brackets"><a class="fn-backref" href="#id25">R248</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/ArcSin">http://functions.wolfram.com/ElementaryFunctions/ArcSin</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.asin.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L2309-L2313"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.asin.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="acos">
<h2>acos<a class="headerlink" href="#acos" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.acos">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.trigonometric.</span></span><span class="sig-name descname"><span class="pre">acos</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L2316-L2528"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.acos" title="Permalink to this definition">¶</a></dt>
<dd><p>The inverse cosine function.</p>
<p>Returns the arc cosine of x (measured in radians).</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">acos</span><span class="p">,</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acos</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acos</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acos</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">oo*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.csc" title="sympy.functions.elementary.trigonometric.csc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">csc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cos" title="sympy.functions.elementary.trigonometric.cos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sec" title="sympy.functions.elementary.trigonometric.sec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.tan" title="sympy.functions.elementary.trigonometric.tan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cot" title="sympy.functions.elementary.trigonometric.cot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asin" title="sympy.functions.elementary.trigonometric.asin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acsc" title="sympy.functions.elementary.trigonometric.acsc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acsc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asec" title="sympy.functions.elementary.trigonometric.asec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan" title="sympy.functions.elementary.trigonometric.atan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acot" title="sympy.functions.elementary.trigonometric.acot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan2" title="sympy.functions.elementary.trigonometric.atan2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan2</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r249"><span class="brackets"><a class="fn-backref" href="#id26">R249</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Inverse_trigonometric_functions">https://en.wikipedia.org/wiki/Inverse_trigonometric_functions</a></p>
</dd>
<dt class="label" id="r250"><span class="brackets"><a class="fn-backref" href="#id27">R250</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/4.23">http://dlmf.nist.gov/4.23</a></p>
</dd>
<dt class="label" id="r251"><span class="brackets"><a class="fn-backref" href="#id28">R251</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/ArcCos">http://functions.wolfram.com/ElementaryFunctions/ArcCos</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.acos.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L2507-L2511"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.acos.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="atan">
<h2>atan<a class="headerlink" href="#atan" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.atan">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.trigonometric.</span></span><span class="sig-name descname"><span class="pre">atan</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L2531-L2721"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.atan" title="Permalink to this definition">¶</a></dt>
<dd><p>The inverse tangent function.</p>
<p>Returns the arc tangent of x (measured in radians).</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">atan(x)</span></code> will evaluate automatically in the cases
<code class="docutils literal notranslate"><span class="pre">oo</span></code>, <code class="docutils literal notranslate"><span class="pre">-oo</span></code>, <code class="docutils literal notranslate"><span class="pre">0</span></code>, <code class="docutils literal notranslate"><span class="pre">1</span></code>, <code class="docutils literal notranslate"><span class="pre">-1</span></code> and for some instances when the
result is a rational multiple of pi (see the eval class method).</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">atan</span><span class="p">,</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">pi/4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">pi/2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.csc" title="sympy.functions.elementary.trigonometric.csc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">csc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cos" title="sympy.functions.elementary.trigonometric.cos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sec" title="sympy.functions.elementary.trigonometric.sec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.tan" title="sympy.functions.elementary.trigonometric.tan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cot" title="sympy.functions.elementary.trigonometric.cot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asin" title="sympy.functions.elementary.trigonometric.asin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acsc" title="sympy.functions.elementary.trigonometric.acsc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acsc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acos" title="sympy.functions.elementary.trigonometric.acos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asec" title="sympy.functions.elementary.trigonometric.asec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acot" title="sympy.functions.elementary.trigonometric.acot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan2" title="sympy.functions.elementary.trigonometric.atan2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan2</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r252"><span class="brackets"><a class="fn-backref" href="#id29">R252</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Inverse_trigonometric_functions">https://en.wikipedia.org/wiki/Inverse_trigonometric_functions</a></p>
</dd>
<dt class="label" id="r253"><span class="brackets"><a class="fn-backref" href="#id30">R253</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/4.23">http://dlmf.nist.gov/4.23</a></p>
</dd>
<dt class="label" id="r254"><span class="brackets"><a class="fn-backref" href="#id31">R254</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/ArcTan">http://functions.wolfram.com/ElementaryFunctions/ArcTan</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.atan.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L2702-L2706"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.atan.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="acot">
<h2>acot<a class="headerlink" href="#acot" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.acot">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.trigonometric.</span></span><span class="sig-name descname"><span class="pre">acot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L2724-L2923"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.acot" title="Permalink to this definition">¶</a></dt>
<dd><p>The inverse cotangent function.</p>
<p>Returns the arc cotangent of x (measured in radians).</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">acot(x)</span></code> will evaluate automatically in the cases <code class="docutils literal notranslate"><span class="pre">oo</span></code>, <code class="docutils literal notranslate"><span class="pre">-oo</span></code>,
<code class="docutils literal notranslate"><span class="pre">zoo</span></code>, <code class="docutils literal notranslate"><span class="pre">0</span></code>, <code class="docutils literal notranslate"><span class="pre">1</span></code>, <code class="docutils literal notranslate"><span class="pre">-1</span></code> and for some instances when the result is a
rational multiple of pi (see the eval class method).</p>
<p>A purely imaginary argument will lead to an <code class="docutils literal notranslate"><span class="pre">acoth</span></code> expression.</p>
<p><code class="docutils literal notranslate"><span class="pre">acot(x)</span></code> has a branch cut along <span class="math notranslate nohighlight">\((-i, i)\)</span>, hence it is discontinuous
at 0. Its range for real <code class="docutils literal notranslate"><span class="pre">x</span></code> is <span class="math notranslate nohighlight">\((-\frac{\pi}{2}, \frac{\pi}{2}]\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">acot</span><span class="p">,</span> <span class="n">sqrt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acot</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acot</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">pi/4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acot</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span> <span class="o">-</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">-5*pi/12</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.csc" title="sympy.functions.elementary.trigonometric.csc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">csc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cos" title="sympy.functions.elementary.trigonometric.cos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sec" title="sympy.functions.elementary.trigonometric.sec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.tan" title="sympy.functions.elementary.trigonometric.tan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cot" title="sympy.functions.elementary.trigonometric.cot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asin" title="sympy.functions.elementary.trigonometric.asin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acsc" title="sympy.functions.elementary.trigonometric.acsc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acsc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acos" title="sympy.functions.elementary.trigonometric.acos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asec" title="sympy.functions.elementary.trigonometric.asec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan" title="sympy.functions.elementary.trigonometric.atan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan2" title="sympy.functions.elementary.trigonometric.atan2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan2</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r255"><span class="brackets"><a class="fn-backref" href="#id32">R255</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/4.23">http://dlmf.nist.gov/4.23</a></p>
</dd>
<dt class="label" id="r256"><span class="brackets"><a class="fn-backref" href="#id33">R256</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/ArcCot">http://functions.wolfram.com/ElementaryFunctions/ArcCot</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.acot.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L2903-L2907"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.acot.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="asec">
<h2>asec<a class="headerlink" href="#asec" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.asec">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.trigonometric.</span></span><span class="sig-name descname"><span class="pre">asec</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L2926-L3105"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.asec" title="Permalink to this definition">¶</a></dt>
<dd><p>The inverse secant function.</p>
<p>Returns the arc secant of x (measured in radians).</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">asec(x)</span></code> will evaluate automatically in the cases <code class="docutils literal notranslate"><span class="pre">oo</span></code>, <code class="docutils literal notranslate"><span class="pre">-oo</span></code>,
<code class="docutils literal notranslate"><span class="pre">0</span></code>, <code class="docutils literal notranslate"><span class="pre">1</span></code>, <code class="docutils literal notranslate"><span class="pre">-1</span></code> and for some instances when the result is a rational
multiple of pi (see the eval class method).</p>
<p><code class="docutils literal notranslate"><span class="pre">asec(x)</span></code> has branch cut in the interval [-1, 1]. For complex arguments,
it can be defined <a class="reference internal" href="#r260" id="id34"><span>[R260]</span></a> as</p>
<div class="math notranslate nohighlight">
\[\operatorname{sec^{-1}}(z) = -i\frac{\log\left(\sqrt{1 - z^2} + 1\right)}{z}\]</div>
<p>At <code class="docutils literal notranslate"><span class="pre">x</span> <span class="pre">=</span> <span class="pre">0</span></code>, for positive branch cut, the limit evaluates to <code class="docutils literal notranslate"><span class="pre">zoo</span></code>. For
negative branch cut, the limit</p>
<div class="math notranslate nohighlight">
\[\lim_{z \to 0}-i\frac{\log\left(-\sqrt{1 - z^2} + 1\right)}{z}\]</div>
<p>simplifies to <span class="math notranslate nohighlight">\(-i\log\left(z/2 + O\left(z^3\right)\right)\)</span> which
ultimately evaluates to <code class="docutils literal notranslate"><span class="pre">zoo</span></code>.</p>
<p>As <code class="docutils literal notranslate"><span class="pre">acos(x)</span></code> = <code class="docutils literal notranslate"><span class="pre">asec(1/x)</span></code>, a similar argument can be given for
<code class="docutils literal notranslate"><span class="pre">acos(x)</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">asec</span><span class="p">,</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asec</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asec</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asec</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">zoo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asec</span><span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">)</span>
<span class="go">pi/2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.csc" title="sympy.functions.elementary.trigonometric.csc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">csc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cos" title="sympy.functions.elementary.trigonometric.cos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sec" title="sympy.functions.elementary.trigonometric.sec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.tan" title="sympy.functions.elementary.trigonometric.tan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cot" title="sympy.functions.elementary.trigonometric.cot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asin" title="sympy.functions.elementary.trigonometric.asin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acsc" title="sympy.functions.elementary.trigonometric.acsc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acsc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acos" title="sympy.functions.elementary.trigonometric.acos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan" title="sympy.functions.elementary.trigonometric.atan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acot" title="sympy.functions.elementary.trigonometric.acot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan2" title="sympy.functions.elementary.trigonometric.atan2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan2</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r257"><span class="brackets"><a class="fn-backref" href="#id35">R257</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Inverse_trigonometric_functions">https://en.wikipedia.org/wiki/Inverse_trigonometric_functions</a></p>
</dd>
<dt class="label" id="r258"><span class="brackets"><a class="fn-backref" href="#id36">R258</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/4.23">http://dlmf.nist.gov/4.23</a></p>
</dd>
<dt class="label" id="r259"><span class="brackets"><a class="fn-backref" href="#id37">R259</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/ArcSec">http://functions.wolfram.com/ElementaryFunctions/ArcSec</a></p>
</dd>
<dt class="label" id="r260"><span class="brackets">R260</span><span class="fn-backref">(<a href="#id34">1</a>,<a href="#id38">2</a>)</span></dt>
<dd><p><a class="reference external" href="http://reference.wolfram.com/language/ref/ArcSec.html">http://reference.wolfram.com/language/ref/ArcSec.html</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.asec.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L3027-L3031"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.asec.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="acsc">
<h2>acsc<a class="headerlink" href="#acsc" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.acsc">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.trigonometric.</span></span><span class="sig-name descname"><span class="pre">acsc</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L3108-L3271"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.acsc" title="Permalink to this definition">¶</a></dt>
<dd><p>The inverse cosecant function.</p>
<p>Returns the arc cosecant of x (measured in radians).</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">acsc(x)</span></code> will evaluate automatically in the cases <code class="docutils literal notranslate"><span class="pre">oo</span></code>, <code class="docutils literal notranslate"><span class="pre">-oo</span></code>,
<code class="docutils literal notranslate"><span class="pre">0</span></code>, <code class="docutils literal notranslate"><span class="pre">1</span></code>, <code class="docutils literal notranslate"><span class="pre">-1</span></code> and for some instances when the result is a rational
multiple of pi (see the eval class method).</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">acsc</span><span class="p">,</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acsc</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acsc</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">-pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acsc</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acsc</span><span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">)</span> <span class="o">==</span> <span class="n">acsc</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acsc</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">zoo</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.csc" title="sympy.functions.elementary.trigonometric.csc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">csc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cos" title="sympy.functions.elementary.trigonometric.cos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sec" title="sympy.functions.elementary.trigonometric.sec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.tan" title="sympy.functions.elementary.trigonometric.tan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cot" title="sympy.functions.elementary.trigonometric.cot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asin" title="sympy.functions.elementary.trigonometric.asin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acos" title="sympy.functions.elementary.trigonometric.acos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asec" title="sympy.functions.elementary.trigonometric.asec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan" title="sympy.functions.elementary.trigonometric.atan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acot" title="sympy.functions.elementary.trigonometric.acot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan2" title="sympy.functions.elementary.trigonometric.atan2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan2</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r261"><span class="brackets"><a class="fn-backref" href="#id39">R261</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Inverse_trigonometric_functions">https://en.wikipedia.org/wiki/Inverse_trigonometric_functions</a></p>
</dd>
<dt class="label" id="r262"><span class="brackets"><a class="fn-backref" href="#id40">R262</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/4.23">http://dlmf.nist.gov/4.23</a></p>
</dd>
<dt class="label" id="r263"><span class="brackets"><a class="fn-backref" href="#id41">R263</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/ArcCsc">http://functions.wolfram.com/ElementaryFunctions/ArcCsc</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.acsc.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L3199-L3203"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.acsc.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="atan2">
<h2>atan2<a class="headerlink" href="#atan2" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.trigonometric.atan2">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.trigonometric.</span></span><span class="sig-name descname"><span class="pre">atan2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/trigonometric.py#L3274-L3455"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.trigonometric.atan2" title="Permalink to this definition">¶</a></dt>
<dd><p>The function <code class="docutils literal notranslate"><span class="pre">atan2(y,</span> <span class="pre">x)</span></code> computes <span class="math notranslate nohighlight">\(\operatorname{atan}(y/x)\)</span> taking
two arguments <span class="math notranslate nohighlight">\(y\)</span> and <span class="math notranslate nohighlight">\(x\)</span>.  Signs of both <span class="math notranslate nohighlight">\(y\)</span> and <span class="math notranslate nohighlight">\(x\)</span> are considered to
determine the appropriate quadrant of <span class="math notranslate nohighlight">\(\operatorname{atan}(y/x)\)</span>.
The range is <span class="math notranslate nohighlight">\((-\pi, \pi]\)</span>. The complete definition reads as follows:</p>
<div class="math notranslate nohighlight">
\[\begin{split}\operatorname{atan2}(y, x) =
\begin{cases}
  \arctan\left(\frac y x\right) &amp; \qquad x &gt; 0 \\
  \arctan\left(\frac y x\right) + \pi&amp; \qquad y \ge 0 , x &lt; 0 \\
  \arctan\left(\frac y x\right) - \pi&amp; \qquad y &lt; 0 , x &lt; 0 \\
  +\frac{\pi}{2} &amp; \qquad y &gt; 0 , x = 0 \\
  -\frac{\pi}{2} &amp; \qquad y &lt; 0 , x = 0 \\
  \text{undefined} &amp; \qquad y = 0, x = 0
\end{cases}\end{split}\]</div>
<p>Attention: Note the role reversal of both arguments. The <span class="math notranslate nohighlight">\(y\)</span>-coordinate
is the first argument and the <span class="math notranslate nohighlight">\(x\)</span>-coordinate the second.</p>
<p>If either <span class="math notranslate nohighlight">\(x\)</span> or <span class="math notranslate nohighlight">\(y\)</span> is complex:</p>
<div class="math notranslate nohighlight">
\[\operatorname{atan2}(y, x) =
    -i\log\left(\frac{x + iy}{\sqrt{x**2 + y**2}}\right)\]</div>
<p class="rubric">Examples</p>
<p>Going counter-clock wise around the origin we find the
following angles:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">atan2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan2</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan2</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">pi/4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan2</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan2</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">3*pi/4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan2</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan2</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">-3*pi/4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan2</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">-pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan2</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">-pi/4</span>
</pre></div>
</div>
<p>which are all correct. Compare this to the results of the ordinary
<span class="math notranslate nohighlight">\(\operatorname{atan}\)</span> function for the point <span class="math notranslate nohighlight">\((x, y) = (-1, 1)\)</span></p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">atan</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">-pi/4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan2</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">3*pi/4</span>
</pre></div>
</div>
<p>where only the <span class="math notranslate nohighlight">\(\operatorname{atan2}\)</span> function reurns what we expect.
We can differentiate the function with respect to both arguments:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">atan2</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-y/(x**2 + y**2)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">atan2</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">y</span><span class="p">)</span>
<span class="go">x/(x**2 + y**2)</span>
</pre></div>
</div>
<p>We can express the <span class="math notranslate nohighlight">\(\operatorname{atan2}\)</span> function in terms of
complex logarithms:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">log</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan2</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">log</span><span class="p">)</span>
<span class="go">-I*log((x + I*y)/sqrt(x**2 + y**2))</span>
</pre></div>
</div>
<p>and in terms of <span class="math notranslate nohighlight">\(\operatorname(atan)\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">atan</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atan2</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">atan</span><span class="p">)</span>
<span class="go">Piecewise((2*atan(y/(x + sqrt(x**2 + y**2))), Ne(y, 0)), (pi, re(x) &lt; 0), (0, Ne(x, 0)), (nan, True))</span>
</pre></div>
</div>
<p>but note that this form is undefined on the negative real axis.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.trigonometric.sin" title="sympy.functions.elementary.trigonometric.sin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.csc" title="sympy.functions.elementary.trigonometric.csc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">csc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cos" title="sympy.functions.elementary.trigonometric.cos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.sec" title="sympy.functions.elementary.trigonometric.sec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.tan" title="sympy.functions.elementary.trigonometric.tan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.cot" title="sympy.functions.elementary.trigonometric.cot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asin" title="sympy.functions.elementary.trigonometric.asin"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asin</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acsc" title="sympy.functions.elementary.trigonometric.acsc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acsc</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acos" title="sympy.functions.elementary.trigonometric.acos"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acos</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.asec" title="sympy.functions.elementary.trigonometric.asec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asec</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.atan" title="sympy.functions.elementary.trigonometric.atan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atan</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.trigonometric.acot" title="sympy.functions.elementary.trigonometric.acot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acot</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r264"><span class="brackets"><a class="fn-backref" href="#id42">R264</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Inverse_trigonometric_functions">https://en.wikipedia.org/wiki/Inverse_trigonometric_functions</a></p>
</dd>
<dt class="label" id="r265"><span class="brackets"><a class="fn-backref" href="#id43">R265</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Atan2">https://en.wikipedia.org/wiki/Atan2</a></p>
</dd>
<dt class="label" id="r266"><span class="brackets"><a class="fn-backref" href="#id44">R266</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/ArcTan2">http://functions.wolfram.com/ElementaryFunctions/ArcTan2</a></p>
</dd>
</dl>
</dd></dl>

</section>
</section>
<section id="sympy-functions-elementary-hyperbolic">
<h1>sympy.functions.elementary.hyperbolic<a class="headerlink" href="#sympy-functions-elementary-hyperbolic" title="Permalink to this headline">¶</a></h1>
</section>
<section id="hyperbolic-functions">
<h1>Hyperbolic Functions<a class="headerlink" href="#hyperbolic-functions" title="Permalink to this headline">¶</a></h1>
<section id="hyperbolicfunction">
<h2>HyperbolicFunction<a class="headerlink" href="#hyperbolicfunction" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.HyperbolicFunction">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.hyperbolic.</span></span><span class="sig-name descname"><span class="pre">HyperbolicFunction</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L24-L34"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.HyperbolicFunction" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for hyperbolic functions.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.hyperbolic.sinh" title="sympy.functions.elementary.hyperbolic.sinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sinh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.cosh" title="sympy.functions.elementary.hyperbolic.cosh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.tanh" title="sympy.functions.elementary.hyperbolic.tanh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tanh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.coth" title="sympy.functions.elementary.hyperbolic.coth"><code class="xref py py-obj docutils literal notranslate"><span class="pre">coth</span></code></a></p>
</div>
</dd></dl>

</section>
<section id="sinh">
<h2>sinh<a class="headerlink" href="#sinh" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.sinh">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.hyperbolic.</span></span><span class="sig-name descname"><span class="pre">sinh</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L70-L274"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.sinh" title="Permalink to this definition">¶</a></dt>
<dd><p>sinh(x) is the hyperbolic sine of x.</p>
<p>The hyperbolic sine function is <span class="math notranslate nohighlight">\(\frac{e^x - e^{-x}}{2}\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sinh</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sinh</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">sinh(x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.hyperbolic.cosh" title="sympy.functions.elementary.hyperbolic.cosh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.tanh" title="sympy.functions.elementary.hyperbolic.tanh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tanh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.asinh" title="sympy.functions.elementary.hyperbolic.asinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asinh</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.sinh.as_real_imag">
<span class="sig-name descname"><span class="pre">as_real_imag</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">deep</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L177-L192"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.sinh.as_real_imag" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns this function as a complex coordinate.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.sinh.fdiff">
<span class="sig-name descname"><span class="pre">fdiff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L90-L97"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.sinh.fdiff" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the first derivative of this function.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.sinh.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L99-L103"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.sinh.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.sinh.taylor_term">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">taylor_term</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">previous_terms</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L157-L172"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.sinh.taylor_term" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the next term in the Taylor series expansion.</p>
</dd></dl>

</dd></dl>

</section>
<section id="cosh">
<h2>cosh<a class="headerlink" href="#cosh" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.cosh">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.hyperbolic.</span></span><span class="sig-name descname"><span class="pre">cosh</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L277-L508"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.cosh" title="Permalink to this definition">¶</a></dt>
<dd><p>cosh(x) is the hyperbolic cosine of x.</p>
<p>The hyperbolic cosine function is <span class="math notranslate nohighlight">\(\frac{e^x + e^{-x}}{2}\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">cosh</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cosh</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">cosh(x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.hyperbolic.sinh" title="sympy.functions.elementary.hyperbolic.sinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sinh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.tanh" title="sympy.functions.elementary.hyperbolic.tanh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tanh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.acosh" title="sympy.functions.elementary.hyperbolic.acosh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acosh</span></code></a></p>
</div>
</dd></dl>

</section>
<section id="tanh">
<h2>tanh<a class="headerlink" href="#tanh" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.tanh">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.hyperbolic.</span></span><span class="sig-name descname"><span class="pre">tanh</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L511-L727"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.tanh" title="Permalink to this definition">¶</a></dt>
<dd><p>tanh(x) is the hyperbolic tangent of x.</p>
<p>The hyperbolic tangent function is <span class="math notranslate nohighlight">\(\frac{\sinh(x)}{\cosh(x)}\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">tanh</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tanh</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">tanh(x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.hyperbolic.sinh" title="sympy.functions.elementary.hyperbolic.sinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sinh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.cosh" title="sympy.functions.elementary.hyperbolic.cosh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.atanh" title="sympy.functions.elementary.hyperbolic.atanh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atanh</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.tanh.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L537-L541"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.tanh.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="coth">
<h2>coth<a class="headerlink" href="#coth" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.coth">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.hyperbolic.</span></span><span class="sig-name descname"><span class="pre">coth</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L730-L905"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.coth" title="Permalink to this definition">¶</a></dt>
<dd><p>coth(x) is the hyperbolic cotangent of x.</p>
<p>The hyperbolic cotangent function is <span class="math notranslate nohighlight">\(\frac{\cosh(x)}{\sinh(x)}\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">coth</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">coth</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">coth(x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.hyperbolic.sinh" title="sympy.functions.elementary.hyperbolic.sinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sinh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.cosh" title="sympy.functions.elementary.hyperbolic.cosh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.acoth" title="sympy.functions.elementary.hyperbolic.acoth"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acoth</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.coth.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L756-L760"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.coth.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="sech">
<h2>sech<a class="headerlink" href="#sech" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.sech">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.hyperbolic.</span></span><span class="sig-name descname"><span class="pre">sech</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1045-L1089"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.sech" title="Permalink to this definition">¶</a></dt>
<dd><p>sech(x) is the hyperbolic secant of x.</p>
<p>The hyperbolic secant function is <span class="math notranslate nohighlight">\(\frac{2}{e^x + e^{-x}}\)</span></p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sech</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sech</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">sech(x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.hyperbolic.sinh" title="sympy.functions.elementary.hyperbolic.sinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sinh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.cosh" title="sympy.functions.elementary.hyperbolic.cosh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.tanh" title="sympy.functions.elementary.hyperbolic.tanh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tanh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.coth" title="sympy.functions.elementary.hyperbolic.coth"><code class="xref py py-obj docutils literal notranslate"><span class="pre">coth</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.csch" title="sympy.functions.elementary.hyperbolic.csch"><code class="xref py py-obj docutils literal notranslate"><span class="pre">csch</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.asinh" title="sympy.functions.elementary.hyperbolic.asinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asinh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.acosh" title="sympy.functions.elementary.hyperbolic.acosh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acosh</span></code></a></p>
</div>
</dd></dl>

</section>
<section id="csch">
<h2>csch<a class="headerlink" href="#csch" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.csch">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.hyperbolic.</span></span><span class="sig-name descname"><span class="pre">csch</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L982-L1042"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.csch" title="Permalink to this definition">¶</a></dt>
<dd><p>csch(x) is the hyperbolic cosecant of x.</p>
<p>The hyperbolic cosecant function is <span class="math notranslate nohighlight">\(\frac{2}{e^x - e^{-x}}\)</span></p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">csch</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">csch</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">csch(x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.hyperbolic.sinh" title="sympy.functions.elementary.hyperbolic.sinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sinh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.cosh" title="sympy.functions.elementary.hyperbolic.cosh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.tanh" title="sympy.functions.elementary.hyperbolic.tanh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tanh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.sech" title="sympy.functions.elementary.hyperbolic.sech"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sech</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.asinh" title="sympy.functions.elementary.hyperbolic.asinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asinh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.acosh" title="sympy.functions.elementary.hyperbolic.acosh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acosh</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.csch.fdiff">
<span class="sig-name descname"><span class="pre">fdiff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1005-L1012"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.csch.fdiff" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the first derivative of this function</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.csch.taylor_term">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">taylor_term</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">previous_terms</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1014-L1031"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.csch.taylor_term" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the next term in the Taylor series expansion</p>
</dd></dl>

</dd></dl>

</section>
</section>
<section id="hyperbolic-inverses">
<h1>Hyperbolic Inverses<a class="headerlink" href="#hyperbolic-inverses" title="Permalink to this headline">¶</a></h1>
<section id="asinh">
<h2>asinh<a class="headerlink" href="#asinh" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.asinh">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.hyperbolic.</span></span><span class="sig-name descname"><span class="pre">asinh</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1102-L1216"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.asinh" title="Permalink to this definition">¶</a></dt>
<dd><p>asinh(x) is the inverse hyperbolic sine of x.</p>
<p>The inverse hyperbolic sine function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">asinh</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asinh</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1/sqrt(x**2 + 1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asinh</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">log(1 + sqrt(2))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.hyperbolic.acosh" title="sympy.functions.elementary.hyperbolic.acosh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acosh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.atanh" title="sympy.functions.elementary.hyperbolic.atanh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atanh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.sinh" title="sympy.functions.elementary.hyperbolic.sinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sinh</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.asinh.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1207-L1211"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.asinh.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="acosh">
<h2>acosh<a class="headerlink" href="#acosh" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.acosh">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.hyperbolic.</span></span><span class="sig-name descname"><span class="pre">acosh</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1219-L1360"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.acosh" title="Permalink to this definition">¶</a></dt>
<dd><p>acosh(x) is the inverse hyperbolic cosine of x.</p>
<p>The inverse hyperbolic cosine function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">acosh</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acosh</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1/sqrt(x**2 - 1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acosh</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.hyperbolic.asinh" title="sympy.functions.elementary.hyperbolic.asinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asinh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.atanh" title="sympy.functions.elementary.hyperbolic.atanh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atanh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.cosh" title="sympy.functions.elementary.hyperbolic.cosh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosh</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.acosh.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1356-L1360"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.acosh.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="atanh">
<h2>atanh<a class="headerlink" href="#atanh" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.atanh">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.hyperbolic.</span></span><span class="sig-name descname"><span class="pre">atanh</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1363-L1470"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.atanh" title="Permalink to this definition">¶</a></dt>
<dd><p>atanh(x) is the inverse hyperbolic tangent of x.</p>
<p>The inverse hyperbolic tangent function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">atanh</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">atanh</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1/(1 - x**2)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.hyperbolic.asinh" title="sympy.functions.elementary.hyperbolic.asinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asinh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.acosh" title="sympy.functions.elementary.hyperbolic.acosh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acosh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.tanh" title="sympy.functions.elementary.hyperbolic.tanh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tanh</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.atanh.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1466-L1470"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.atanh.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="acoth">
<h2>acoth<a class="headerlink" href="#acoth" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.acoth">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.hyperbolic.</span></span><span class="sig-name descname"><span class="pre">acoth</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1473-L1561"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.acoth" title="Permalink to this definition">¶</a></dt>
<dd><p>acoth(x) is the inverse hyperbolic cotangent of x.</p>
<p>The inverse hyperbolic cotangent function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">acoth</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acoth</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1/(1 - x**2)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.hyperbolic.asinh" title="sympy.functions.elementary.hyperbolic.asinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asinh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.acosh" title="sympy.functions.elementary.hyperbolic.acosh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acosh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.coth" title="sympy.functions.elementary.hyperbolic.coth"><code class="xref py py-obj docutils literal notranslate"><span class="pre">coth</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.acoth.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1557-L1561"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.acoth.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="asech">
<h2>asech<a class="headerlink" href="#asech" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.asech">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.hyperbolic.</span></span><span class="sig-name descname"><span class="pre">asech</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1564-L1692"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.asech" title="Permalink to this definition">¶</a></dt>
<dd><p>asech(x) is the inverse hyperbolic secant of x.</p>
<p>The inverse hyperbolic secant function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">asech</span><span class="p">,</span> <span class="n">sqrt</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asech</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">-1/(x*sqrt(1 - x**2))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asech</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asech</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asech</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">I*pi/3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asech</span><span class="p">(</span><span class="o">-</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">3*I*pi/4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">asech</span><span class="p">((</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">6</span><span class="p">)</span> <span class="o">-</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">)))</span>
<span class="go">I*pi/12</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.hyperbolic.asinh" title="sympy.functions.elementary.hyperbolic.asinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asinh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.atanh" title="sympy.functions.elementary.hyperbolic.atanh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">atanh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.cosh" title="sympy.functions.elementary.hyperbolic.cosh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosh</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.hyperbolic.acoth" title="sympy.functions.elementary.hyperbolic.acoth"><code class="xref py py-obj docutils literal notranslate"><span class="pre">acoth</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r267"><span class="brackets"><a class="fn-backref" href="#id45">R267</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Hyperbolic_function">https://en.wikipedia.org/wiki/Hyperbolic_function</a></p>
</dd>
<dt class="label" id="r268"><span class="brackets"><a class="fn-backref" href="#id46">R268</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/4.37">http://dlmf.nist.gov/4.37</a></p>
</dd>
<dt class="label" id="r269"><span class="brackets"><a class="fn-backref" href="#id47">R269</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/ArcSech/">http://functions.wolfram.com/ElementaryFunctions/ArcSech/</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.asech.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1685-L1689"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.asech.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="acsch">
<h2>acsch<a class="headerlink" href="#acsch" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.acsch">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.hyperbolic.</span></span><span class="sig-name descname"><span class="pre">acsch</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1695-L1794"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.acsch" title="Permalink to this definition">¶</a></dt>
<dd><p>acsch(x) is the inverse hyperbolic cosecant of x.</p>
<p>The inverse hyperbolic cosecant function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">acsch</span><span class="p">,</span> <span class="n">sqrt</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acsch</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">-1/(x**2*sqrt(1 + x**(-2)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acsch</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acsch</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">log(1 + sqrt(2))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acsch</span><span class="p">(</span><span class="n">S</span><span class="o">.</span><span class="n">ImaginaryUnit</span><span class="p">)</span>
<span class="go">-I*pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acsch</span><span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="o">*</span><span class="n">S</span><span class="o">.</span><span class="n">ImaginaryUnit</span><span class="p">)</span>
<span class="go">I*pi/6</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acsch</span><span class="p">(</span><span class="n">S</span><span class="o">.</span><span class="n">ImaginaryUnit</span><span class="o">*</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">6</span><span class="p">)</span> <span class="o">-</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">)))</span>
<span class="go">-5*I*pi/12</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.hyperbolic.asinh" title="sympy.functions.elementary.hyperbolic.asinh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asinh</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r270"><span class="brackets"><a class="fn-backref" href="#id48">R270</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Hyperbolic_function">https://en.wikipedia.org/wiki/Hyperbolic_function</a></p>
</dd>
<dt class="label" id="r271"><span class="brackets"><a class="fn-backref" href="#id49">R271</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/4.37">http://dlmf.nist.gov/4.37</a></p>
</dd>
<dt class="label" id="r272"><span class="brackets"><a class="fn-backref" href="#id50">R272</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/ElementaryFunctions/ArcCsch/">http://functions.wolfram.com/ElementaryFunctions/ArcCsch/</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.hyperbolic.acsch.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/hyperbolic.py#L1787-L1791"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.hyperbolic.acsch.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

</section>
</section>
<section id="sympy-functions-elementary-integers">
<h1>sympy.functions.elementary.integers<a class="headerlink" href="#sympy-functions-elementary-integers" title="Permalink to this headline">¶</a></h1>
<section id="ceiling">
<h2>ceiling<a class="headerlink" href="#ceiling" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.integers.ceiling">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.integers.</span></span><span class="sig-name descname"><span class="pre">ceiling</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/integers.py#L244-L393"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.integers.ceiling" title="Permalink to this definition">¶</a></dt>
<dd><p>Ceiling is a univariate function which returns the smallest integer
value not less than its argument. This implementation
generalizes ceiling to complex numbers by taking the ceiling of the
real and imaginary parts separately.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ceiling</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">S</span><span class="p">,</span> <span class="n">Float</span><span class="p">,</span> <span class="n">Rational</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ceiling</span><span class="p">(</span><span class="mi">17</span><span class="p">)</span>
<span class="go">17</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ceiling</span><span class="p">(</span><span class="n">Rational</span><span class="p">(</span><span class="mi">23</span><span class="p">,</span> <span class="mi">10</span><span class="p">))</span>
<span class="go">3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ceiling</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">E</span><span class="p">)</span>
<span class="go">6</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ceiling</span><span class="p">(</span><span class="o">-</span><span class="n">Float</span><span class="p">(</span><span class="mf">0.567</span><span class="p">))</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ceiling</span><span class="p">(</span><span class="n">I</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span>
<span class="go">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ceiling</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">I</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span>
<span class="go">3 + 3*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.integers.floor" title="sympy.functions.elementary.integers.floor"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.functions.elementary.integers.floor</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r273"><span class="brackets"><a class="fn-backref" href="#id51">R273</a></span></dt>
<dd><p>“Concrete mathematics” by Graham, pp. 87</p>
</dd>
<dt class="label" id="r274"><span class="brackets"><a class="fn-backref" href="#id52">R274</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/CeilingFunction.html">http://mathworld.wolfram.com/CeilingFunction.html</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="floor">
<h2>floor<a class="headerlink" href="#floor" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.integers.floor">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.integers.</span></span><span class="sig-name descname"><span class="pre">floor</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/integers.py#L86-L235"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.integers.floor" title="Permalink to this definition">¶</a></dt>
<dd><p>Floor is a univariate function which returns the largest integer
value not greater than its argument. This implementation
generalizes floor to complex numbers by taking the floor of the
real and imaginary parts separately.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">floor</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">S</span><span class="p">,</span> <span class="n">Float</span><span class="p">,</span> <span class="n">Rational</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">floor</span><span class="p">(</span><span class="mi">17</span><span class="p">)</span>
<span class="go">17</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">floor</span><span class="p">(</span><span class="n">Rational</span><span class="p">(</span><span class="mi">23</span><span class="p">,</span> <span class="mi">10</span><span class="p">))</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">floor</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">E</span><span class="p">)</span>
<span class="go">5</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">floor</span><span class="p">(</span><span class="o">-</span><span class="n">Float</span><span class="p">(</span><span class="mf">0.567</span><span class="p">))</span>
<span class="go">-1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">floor</span><span class="p">(</span><span class="o">-</span><span class="n">I</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span>
<span class="go">-I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">floor</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">I</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span>
<span class="go">2 + 2*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.integers.ceiling" title="sympy.functions.elementary.integers.ceiling"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.functions.elementary.integers.ceiling</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r275"><span class="brackets"><a class="fn-backref" href="#id53">R275</a></span></dt>
<dd><p>“Concrete mathematics” by Graham, pp. 87</p>
</dd>
<dt class="label" id="r276"><span class="brackets"><a class="fn-backref" href="#id54">R276</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/FloorFunction.html">http://mathworld.wolfram.com/FloorFunction.html</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="roundfunction">
<h2>RoundFunction<a class="headerlink" href="#roundfunction" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.integers.RoundFunction">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.integers.</span></span><span class="sig-name descname"><span class="pre">RoundFunction</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/integers.py#L18-L83"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.integers.RoundFunction" title="Permalink to this definition">¶</a></dt>
<dd><p>The base class for rounding functions.</p>
</dd></dl>

</section>
<section id="frac">
<h2>frac<a class="headerlink" href="#frac" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.integers.frac">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.integers.</span></span><span class="sig-name descname"><span class="pre">frac</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/integers.py#L401-L565"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.integers.frac" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents the fractional part of x</p>
<p>For real numbers it is defined <a class="reference internal" href="#r277" id="id55"><span>[R277]</span></a> as</p>
<div class="math notranslate nohighlight">
\[x - \left\lfloor{x}\right\rfloor\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">frac</span><span class="p">,</span> <span class="n">Rational</span><span class="p">,</span> <span class="n">floor</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">frac</span><span class="p">(</span><span class="n">Rational</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span>
<span class="go">1/3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">frac</span><span class="p">(</span><span class="o">-</span><span class="n">Rational</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span>
<span class="go">2/3</span>
</pre></div>
</div>
<p>returns zero for integer arguments</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">n</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;n&#39;</span><span class="p">,</span> <span class="n">integer</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">frac</span><span class="p">(</span><span class="n">n</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<p>rewrite as floor</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">frac</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">floor</span><span class="p">)</span>
<span class="go">x - floor(x)</span>
</pre></div>
</div>
<p>for complex arguments</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">r</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;r&#39;</span><span class="p">,</span> <span class="n">real</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">t</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;t&#39;</span><span class="p">,</span> <span class="n">real</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">frac</span><span class="p">(</span><span class="n">t</span> <span class="o">+</span> <span class="n">I</span><span class="o">*</span><span class="n">r</span><span class="p">)</span>
<span class="go">I*frac(r) + frac(t)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.integers.floor" title="sympy.functions.elementary.integers.floor"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.functions.elementary.integers.floor</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.integers.ceiling" title="sympy.functions.elementary.integers.ceiling"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.functions.elementary.integers.ceiling</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r277"><span class="brackets">R277</span><span class="fn-backref">(<a href="#id55">1</a>,<a href="#id56">2</a>)</span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Fractional_part">https://en.wikipedia.org/wiki/Fractional_part</a></p>
</dd>
<dt class="label" id="r278"><span class="brackets"><a class="fn-backref" href="#id57">R278</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/FractionalPart.html">http://mathworld.wolfram.com/FractionalPart.html</a></p>
</dd>
</dl>
</dd></dl>

</section>
</section>
<section id="sympy-functions-elementary-exponential">
<h1>sympy.functions.elementary.exponential<a class="headerlink" href="#sympy-functions-elementary-exponential" title="Permalink to this headline">¶</a></h1>
<section id="exp">
<h2>exp<a class="headerlink" href="#exp" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.exponential.exp">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.exponential.</span></span><span class="sig-name descname"><span class="pre">exp</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/exponential.py#L213-L557"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.exponential.exp" title="Permalink to this definition">¶</a></dt>
<dd><p>The exponential function, <span class="math notranslate nohighlight">\(e^x\)</span>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>arg</strong> : Expr</p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions</span> <span class="kn">import</span> <span class="n">exp</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">I</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">exp(x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">exp(x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">exp</span><span class="p">(</span><span class="n">I</span><span class="o">*</span><span class="n">pi</span><span class="p">)</span>
<span class="go">-1</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.exponential.log" title="sympy.functions.elementary.exponential.log"><code class="xref py py-obj docutils literal notranslate"><span class="pre">log</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.exponential.exp.as_real_imag">
<span class="sig-name descname"><span class="pre">as_real_imag</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">deep</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/exponential.py#L400-L431"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.exponential.exp.as_real_imag" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns this function as a 2-tuple representing a complex number.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions</span> <span class="kn">import</span> <span class="n">exp</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">as_real_imag</span><span class="p">()</span>
<span class="go">(exp(re(x))*cos(im(x)), exp(re(x))*sin(im(x)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">exp</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">as_real_imag</span><span class="p">()</span>
<span class="go">(E, 0)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">exp</span><span class="p">(</span><span class="n">I</span><span class="p">)</span><span class="o">.</span><span class="n">as_real_imag</span><span class="p">()</span>
<span class="go">(cos(1), sin(1))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">exp</span><span class="p">(</span><span class="mi">1</span><span class="o">+</span><span class="n">I</span><span class="p">)</span><span class="o">.</span><span class="n">as_real_imag</span><span class="p">()</span>
<span class="go">(E*cos(1), E*sin(1))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.complexes.re" title="sympy.functions.elementary.complexes.re"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.functions.elementary.complexes.re</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.complexes.im" title="sympy.functions.elementary.complexes.im"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.functions.elementary.complexes.im</span></code></a></p>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.elementary.exponential.exp.base">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">base</span></span><a class="headerlink" href="#sympy.functions.elementary.exponential.exp.base" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the base of the exponential function.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.exponential.exp.fdiff">
<span class="sig-name descname"><span class="pre">fdiff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/exponential.py#L241-L248"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.exponential.exp.fdiff" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the first derivative of this function.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.exponential.exp.taylor_term">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">taylor_term</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">previous_terms</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/exponential.py#L383-L398"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.exponential.exp.taylor_term" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the next term in the Taylor series expansion.</p>
</dd></dl>

</dd></dl>

</section>
<section id="lambertw">
<h2>LambertW<a class="headerlink" href="#lambertw" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.exponential.LambertW">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.exponential.</span></span><span class="sig-name descname"><span class="pre">LambertW</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/exponential.py#L1054-L1209"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.exponential.LambertW" title="Permalink to this definition">¶</a></dt>
<dd><p>The Lambert W function <span class="math notranslate nohighlight">\(W(z)\)</span> is defined as the inverse
function of <span class="math notranslate nohighlight">\(w \exp(w)\)</span> <a class="reference internal" href="#r279" id="id58"><span>[R279]</span></a>.</p>
<p class="rubric">Explanation</p>
<p>In other words, the value of <span class="math notranslate nohighlight">\(W(z)\)</span> is such that <span class="math notranslate nohighlight">\(z = W(z) \exp(W(z))\)</span>
for any complex number <span class="math notranslate nohighlight">\(z\)</span>.  The Lambert W function is a multivalued
function with infinitely many branches <span class="math notranslate nohighlight">\(W_k(z)\)</span>, indexed by
<span class="math notranslate nohighlight">\(k \in \mathbb{Z}\)</span>.  Each branch gives a different solution <span class="math notranslate nohighlight">\(w\)</span>
of the equation <span class="math notranslate nohighlight">\(z = w \exp(w)\)</span>.</p>
<p>The Lambert W function has two partially real branches: the
principal branch (<span class="math notranslate nohighlight">\(k = 0\)</span>) is real for real <span class="math notranslate nohighlight">\(z &gt; -1/e\)</span>, and the
<span class="math notranslate nohighlight">\(k = -1\)</span> branch is real for <span class="math notranslate nohighlight">\(-1/e &lt; z &lt; 0\)</span>. All branches except
<span class="math notranslate nohighlight">\(k = 0\)</span> have a logarithmic singularity at <span class="math notranslate nohighlight">\(z = 0\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">LambertW</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">LambertW</span><span class="p">(</span><span class="mf">1.2</span><span class="p">)</span>
<span class="go">0.635564016364870</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">LambertW</span><span class="p">(</span><span class="mf">1.2</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">n</span><span class="p">()</span>
<span class="go">-1.34747534407696 - 4.41624341514535*I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">LambertW</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">is_real</span>
<span class="go">False</span>
</pre></div>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r279"><span class="brackets">R279</span><span class="fn-backref">(<a href="#id58">1</a>,<a href="#id59">2</a>)</span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Lambert_W_function">https://en.wikipedia.org/wiki/Lambert_W_function</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.exponential.LambertW.fdiff">
<span class="sig-name descname"><span class="pre">fdiff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/exponential.py#L1129-L1143"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.exponential.LambertW.fdiff" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the first derivative of this function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="log">
<h2>log<a class="headerlink" href="#log" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.exponential.log">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.exponential.</span></span><span class="sig-name descname"><span class="pre">log</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">base</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/exponential.py#L581-L1051"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.exponential.log" title="Permalink to this definition">¶</a></dt>
<dd><p>The natural logarithm function <span class="math notranslate nohighlight">\(\ln(x)\)</span> or <span class="math notranslate nohighlight">\(\log(x)\)</span>.</p>
<p class="rubric">Explanation</p>
<p>Logarithms are taken with the natural base, <span class="math notranslate nohighlight">\(e\)</span>. To get
a logarithm of a different base <code class="docutils literal notranslate"><span class="pre">b</span></code>, use <code class="docutils literal notranslate"><span class="pre">log(x,</span> <span class="pre">b)</span></code>,
which is essentially short-hand for <code class="docutils literal notranslate"><span class="pre">log(x)/log(b)</span></code>.</p>
<p><code class="docutils literal notranslate"><span class="pre">log</span></code> represents the principal branch of the natural
logarithm. As such it has a branch cut along the negative
real axis and returns values having a complex argument in
<span class="math notranslate nohighlight">\((-\pi, \pi]\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">log</span><span class="p">,</span> <span class="n">sqrt</span><span class="p">,</span> <span class="n">S</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">log</span><span class="p">(</span><span class="mi">8</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">log</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">8</span><span class="p">)</span><span class="o">/</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">-log(3)/log(2) + 3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">log</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span> <span class="o">+</span> <span class="n">I</span><span class="o">*</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">3</span><span class="p">))</span>
<span class="go">log(2) + 2*I*pi/3</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.exponential.exp" title="sympy.functions.elementary.exponential.exp"><code class="xref py py-obj docutils literal notranslate"><span class="pre">exp</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.exponential.log.as_base_exp">
<span class="sig-name descname"><span class="pre">as_base_exp</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/exponential.py#L779-L783"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.exponential.log.as_base_exp" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns this function in the form (base, exponent).</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.exponential.log.as_real_imag">
<span class="sig-name descname"><span class="pre">as_real_imag</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">deep</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/exponential.py#L872-L904"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.exponential.log.as_real_imag" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns this function as a complex coordinate.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions</span> <span class="kn">import</span> <span class="n">log</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">as_real_imag</span><span class="p">()</span>
<span class="go">(log(Abs(x)), arg(x))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">log</span><span class="p">(</span><span class="n">I</span><span class="p">)</span><span class="o">.</span><span class="n">as_real_imag</span><span class="p">()</span>
<span class="go">(0, pi/2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">log</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">I</span><span class="p">)</span><span class="o">.</span><span class="n">as_real_imag</span><span class="p">()</span>
<span class="go">(log(sqrt(2)), pi/4)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">log</span><span class="p">(</span><span class="n">I</span><span class="o">*</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">as_real_imag</span><span class="p">()</span>
<span class="go">(log(Abs(x)), arg(I*x))</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.exponential.log.fdiff">
<span class="sig-name descname"><span class="pre">fdiff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/exponential.py#L616-L623"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.exponential.log.fdiff" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the first derivative of the function.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.exponential.log.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/exponential.py#L625-L629"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.exponential.log.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <span class="math notranslate nohighlight">\(e^x\)</span>, the inverse function of <span class="math notranslate nohighlight">\(\log(x)\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.exponential.log.taylor_term">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">taylor_term</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">previous_terms</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/exponential.py#L785-L801"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.exponential.log.taylor_term" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the next term in the Taylor series expansion of <span class="math notranslate nohighlight">\(\log(1+x)\)</span>.</p>
</dd></dl>

</dd></dl>

</section>
<section id="exp-polar">
<h2>exp_polar<a class="headerlink" href="#exp-polar" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.exponential.exp_polar">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.exponential.</span></span><span class="sig-name descname"><span class="pre">exp_polar</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/exponential.py#L131-L203"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.exponential.exp_polar" title="Permalink to this definition">¶</a></dt>
<dd><p>Represent a ‘polar number’ (see g-function Sphinx documentation).</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">exp_polar</span></code> represents the function
<span class="math notranslate nohighlight">\(Exp: \mathbb{C} \rightarrow \mathcal{S}\)</span>, sending the complex number
<span class="math notranslate nohighlight">\(z = a + bi\)</span> to the polar number <span class="math notranslate nohighlight">\(r = exp(a), \theta = b\)</span>. It is one of
the main functions to construct polar numbers.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp_polar</span><span class="p">,</span> <span class="n">pi</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">exp</span>
</pre></div>
</div>
<p>The main difference is that polar numbers don’t “wrap around” at <span class="math notranslate nohighlight">\(2 \pi\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">exp</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">pi</span><span class="o">*</span><span class="n">I</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">pi</span><span class="o">*</span><span class="n">I</span><span class="p">)</span>
<span class="go">exp_polar(2*I*pi)</span>
</pre></div>
</div>
<p>apart from that they behave mostly like classical complex numbers:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">*</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
<span class="go">exp_polar(5)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="../simplify/simplify.html#sympy.simplify.powsimp.powsimp" title="sympy.simplify.powsimp.powsimp"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.simplify.powsimp.powsimp</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.complexes.polar_lift" title="sympy.functions.elementary.complexes.polar_lift"><code class="xref py py-obj docutils literal notranslate"><span class="pre">polar_lift</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.complexes.periodic_argument" title="sympy.functions.elementary.complexes.periodic_argument"><code class="xref py py-obj docutils literal notranslate"><span class="pre">periodic_argument</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.complexes.principal_branch" title="sympy.functions.elementary.complexes.principal_branch"><code class="xref py py-obj docutils literal notranslate"><span class="pre">principal_branch</span></code></a></p>
</div>
</dd></dl>

</section>
</section>
<section id="sympy-functions-elementary-piecewise">
<h1>sympy.functions.elementary.piecewise<a class="headerlink" href="#sympy-functions-elementary-piecewise" title="Permalink to this headline">¶</a></h1>
<section id="exprcondpair">
<h2>ExprCondPair<a class="headerlink" href="#exprcondpair" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.piecewise.ExprCondPair">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.piecewise.</span></span><span class="sig-name descname"><span class="pre">ExprCondPair</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">expr</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cond</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/piecewise.py#L15-L58"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.piecewise.ExprCondPair" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents an expression, condition pair.</p>
<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.elementary.piecewise.ExprCondPair.cond">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">cond</span></span><a class="headerlink" href="#sympy.functions.elementary.piecewise.ExprCondPair.cond" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the condition of this pair.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.elementary.piecewise.ExprCondPair.expr">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">expr</span></span><a class="headerlink" href="#sympy.functions.elementary.piecewise.ExprCondPair.expr" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the expression of this pair.</p>
</dd></dl>

</dd></dl>

</section>
<section id="piecewise">
<h2>Piecewise<a class="headerlink" href="#piecewise" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.piecewise.Piecewise">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.piecewise.</span></span><span class="sig-name descname"><span class="pre">Piecewise</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">_args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/piecewise.py#L60-L1046"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.piecewise.Piecewise" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents a piecewise function.</p>
<p>Usage:</p>
<blockquote>
<div><dl class="simple">
<dt>Piecewise( (expr,cond), (expr,cond), … )</dt><dd><ul class="simple">
<li><p>Each argument is a 2-tuple defining an expression and condition</p></li>
<li><p>The conds are evaluated in turn returning the first that is True.
If any of the evaluated conds are not determined explicitly False,
e.g. x &lt; 1, the function is returned in symbolic form.</p></li>
<li><p>If the function is evaluated at a place where all conditions are False,
nan will be returned.</p></li>
<li><p>Pairs where the cond is explicitly False, will be removed.</p></li>
</ul>
</dd>
</dl>
</div></blockquote>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Piecewise</span><span class="p">,</span> <span class="n">log</span><span class="p">,</span> <span class="n">piecewise_fold</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span> <span class="o">=</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">g</span> <span class="o">=</span> <span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Piecewise</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span> <span class="o">&lt;</span> <span class="o">-</span><span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">x</span> <span class="o">&lt;=</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="n">g</span><span class="p">,</span> <span class="kc">True</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
<span class="go">log(5)</span>
</pre></div>
</div>
<p>Booleans can contain Piecewise elements:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">cond</span> <span class="o">=</span> <span class="p">(</span><span class="n">x</span> <span class="o">&lt;</span> <span class="n">y</span><span class="p">)</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">Piecewise</span><span class="p">((</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="kc">True</span><span class="p">)));</span> <span class="n">cond</span>
<span class="go">Piecewise((2, x &lt; 0), (3, True)) &lt; y</span>
</pre></div>
</div>
<p>The folded version of this results in a Piecewise whose
expressions are Booleans:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">folded_cond</span> <span class="o">=</span> <span class="n">piecewise_fold</span><span class="p">(</span><span class="n">cond</span><span class="p">);</span> <span class="n">folded_cond</span>
<span class="go">Piecewise((2 &lt; y, x &lt; 0), (3 &lt; y, True))</span>
</pre></div>
</div>
<p>When a Boolean containing Piecewise (like cond) or a Piecewise
with Boolean expressions (like folded_cond) is used as a condition,
it is converted to an equivalent ITE object:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Piecewise</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="n">folded_cond</span><span class="p">))</span>
<span class="go">Piecewise((1, ITE(x &lt; 0, y &gt; 2, y &gt; 3)))</span>
</pre></div>
</div>
<p>When a condition is an ITE, it will be converted to a simplified
Boolean expression:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">piecewise_fold</span><span class="p">(</span><span class="n">_</span><span class="p">)</span>
<span class="go">Piecewise((1, ((x &gt;= 0) | (y &gt; 2)) &amp; ((y &gt; 3) | (x &lt; 0))))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.piecewise.piecewise_fold" title="sympy.functions.elementary.piecewise.piecewise_fold"><code class="xref py py-obj docutils literal notranslate"><span class="pre">piecewise_fold</span></code></a>, <a class="reference internal" href="../logic.html#sympy.logic.boolalg.ITE" title="sympy.logic.boolalg.ITE"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ITE</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.piecewise.Piecewise._eval_integral">
<span class="sig-name descname"><span class="pre">_eval_integral</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">_first</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/piecewise.py#L442-L528"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.piecewise.Piecewise._eval_integral" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the indefinite integral of the
Piecewise such that subsequent substitution of x with a
value will give the value of the integral (not including
the constant of integration) up to that point. To only
integrate the individual parts of Piecewise, use the
<span class="math notranslate nohighlight">\(piecewise_integrate\)</span> method.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Piecewise</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Piecewise</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span> <span class="o">&lt;</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="kc">True</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">integrate</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">Piecewise((0, x &lt; 0), (x, x &lt; 1), (2*x - 1, True))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">piecewise_integrate</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">Piecewise((0, x &lt; 0), (x, x &lt; 1), (2*x, True))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.piecewise.Piecewise.piecewise_integrate" title="sympy.functions.elementary.piecewise.Piecewise.piecewise_integrate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Piecewise.piecewise_integrate</span></code></a></p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.piecewise.Piecewise.as_expr_set_pairs">
<span class="sig-name descname"><span class="pre">as_expr_set_pairs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">domain</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/piecewise.py#L895-L942"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.piecewise.Piecewise.as_expr_set_pairs" title="Permalink to this definition">¶</a></dt>
<dd><p>Return tuples for each argument of self that give
the expression and the interval in which it is valid
which is contained within the given domain.
If a condition cannot be converted to a set, an error
will be raised. The variable of the conditions is
assumed to be real; sets of real values are returned.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Piecewise</span><span class="p">,</span> <span class="n">Interval</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Piecewise</span><span class="p">(</span>
<span class="gp">... </span>    <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span> <span class="o">&lt;</span> <span class="mi">2</span><span class="p">),</span>
<span class="gp">... </span>    <span class="p">(</span><span class="mi">2</span><span class="p">,(</span><span class="n">x</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">&amp;</span> <span class="p">(</span><span class="n">x</span> <span class="o">&lt;</span> <span class="mi">4</span><span class="p">)),</span>
<span class="gp">... </span>    <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="kc">True</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">as_expr_set_pairs</span><span class="p">()</span>
<span class="go">[(1, Interval.open(-oo, 2)),</span>
<span class="go"> (2, Interval.Ropen(2, 4)),</span>
<span class="go"> (3, Interval(4, oo))]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">as_expr_set_pairs</span><span class="p">(</span><span class="n">Interval</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span>
<span class="go">[(1, Interval.Ropen(0, 2)),</span>
<span class="go"> (2, Interval(2, 3))]</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.piecewise.Piecewise.doit">
<span class="sig-name descname"><span class="pre">doit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/piecewise.py#L302-L316"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.piecewise.Piecewise.doit" title="Permalink to this definition">¶</a></dt>
<dd><p>Evaluate this piecewise function.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.piecewise.Piecewise.eval">
<em class="property"><span class="pre">classmethod</span> </em><span class="sig-name descname"><span class="pre">eval</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">_args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/piecewise.py#L145-L300"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.piecewise.Piecewise.eval" title="Permalink to this definition">¶</a></dt>
<dd><p>Either return a modified version of the args or, if no
modifications were made, return None.</p>
<p>Modifications that are made here:
1) relationals are made canonical
2) any False conditions are dropped
3) any repeat of a previous condition is ignored
3) any args past one with a true condition are dropped</p>
<p>If there are no args left, nan will be returned.
If there is a single arg with a True condition, its
corresponding expression will be returned.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.elementary.piecewise.Piecewise.piecewise_integrate">
<span class="sig-name descname"><span class="pre">piecewise_integrate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/piecewise.py#L338-L373"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.piecewise.Piecewise.piecewise_integrate" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the Piecewise with each expression being
replaced with its antiderivative. To obtain a continuous
antiderivative, use the <span class="math notranslate nohighlight">\(integrate\)</span> function or method.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Piecewise</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Piecewise</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span> <span class="o">&lt;</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="kc">True</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">piecewise_integrate</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">Piecewise((0, x &lt; 0), (x, x &lt; 1), (2*x, True))</span>
</pre></div>
</div>
<p>Note that this does not give a continuous function, e.g.
at x = 1 the 3rd condition applies and the antiderivative
there is 2*x so the value of the antiderivative is 2:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">anti</span> <span class="o">=</span> <span class="n">_</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">anti</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
<p>The continuous derivative accounts for the integral <em>up to</em>
the point of interest, however:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">integrate</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">Piecewise((0, x &lt; 0), (x, x &lt; 1), (2*x - 1, True))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">1</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.piecewise.Piecewise._eval_integral" title="sympy.functions.elementary.piecewise.Piecewise._eval_integral"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Piecewise._eval_integral</span></code></a></p>
</div>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.functions.elementary.piecewise.piecewise_fold">
<span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.piecewise.</span></span><span class="sig-name descname"><span class="pre">piecewise_fold</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">expr</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/piecewise.py#L1049-L1143"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.piecewise.piecewise_fold" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes an expression containing a piecewise function and returns the
expression in piecewise form. In addition, any ITE conditions are
rewritten in negation normal form and simplified.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Piecewise</span><span class="p">,</span> <span class="n">piecewise_fold</span><span class="p">,</span> <span class="n">sympify</span> <span class="k">as</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Piecewise</span><span class="p">((</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span> <span class="o">&lt;</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="o">&lt;=</span> <span class="n">x</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">piecewise_fold</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">p</span><span class="p">)</span>
<span class="go">Piecewise((x**2, x &lt; 1), (x, True))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.elementary.piecewise.Piecewise" title="sympy.functions.elementary.piecewise.Piecewise"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Piecewise</span></code></a></p>
</div>
</dd></dl>

</section>
</section>
<section id="sympy-functions-elementary-miscellaneous">
<h1>sympy.functions.elementary.miscellaneous<a class="headerlink" href="#sympy-functions-elementary-miscellaneous" title="Permalink to this headline">¶</a></h1>
<section id="identityfunction">
<h2>IdentityFunction<a class="headerlink" href="#identityfunction" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.miscellaneous.IdentityFunction">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.miscellaneous.</span></span><span class="sig-name descname"><span class="pre">IdentityFunction</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/miscellaneous.py#L33-L55"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.miscellaneous.IdentityFunction" title="Permalink to this definition">¶</a></dt>
<dd><p>The identity function</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Id</span><span class="p">,</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Id</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">x</span>
</pre></div>
</div>
</dd></dl>

</section>
<section id="min">
<h2>Min<a class="headerlink" href="#min" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.miscellaneous.Min">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.miscellaneous.</span></span><span class="sig-name descname"><span class="pre">Min</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/miscellaneous.py#L808-L868"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.miscellaneous.Min" title="Permalink to this definition">¶</a></dt>
<dd><p>Return, if possible, the minimum value of the list.
It is named <code class="docutils literal notranslate"><span class="pre">Min</span></code> and not <code class="docutils literal notranslate"><span class="pre">min</span></code> to avoid conflicts
with the built-in function <code class="docutils literal notranslate"><span class="pre">min</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Min</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;p&#39;</span><span class="p">,</span> <span class="n">positive</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">n</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;n&#39;</span><span class="p">,</span> <span class="n">negative</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Min</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="go">Min(-2, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Min</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">-2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Min</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="o">-</span><span class="mi">3</span><span class="p">)</span>
<span class="go">-3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Min</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>
<span class="go">Min(x, y)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Min</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="o">-</span><span class="mi">7</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">oo</span><span class="p">)</span>
<span class="go">Min(-7, n)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.elementary.miscellaneous.Max" title="sympy.functions.elementary.miscellaneous.Max"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Max</span></code></a></dt><dd><p>find maximum values</p>
</dd>
</dl>
</div>
</dd></dl>

</section>
<section id="max">
<h2>Max<a class="headerlink" href="#max" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.elementary.miscellaneous.Max">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.miscellaneous.</span></span><span class="sig-name descname"><span class="pre">Max</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/miscellaneous.py#L690-L805"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.miscellaneous.Max" title="Permalink to this definition">¶</a></dt>
<dd><p>Return, if possible, the maximum value of the list.</p>
<p>When number of arguments is equal one, then
return this argument.</p>
<p>When number of arguments is equal two, then
return, if possible, the value from (a, b) that is &gt;= the other.</p>
<p>In common case, when the length of list greater than 2, the task
is more complicated. Return only the arguments, which are greater
than others, if it is possible to determine directional relation.</p>
<p>If is not possible to determine such a relation, return a partially
evaluated result.</p>
<p>Assumptions are used to make the decision too.</p>
<p>Also, only comparable arguments are permitted.</p>
<p>It is named <code class="docutils literal notranslate"><span class="pre">Max</span></code> and not <code class="docutils literal notranslate"><span class="pre">max</span></code> to avoid conflicts
with the built-in function <code class="docutils literal notranslate"><span class="pre">max</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Max</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;p&#39;</span><span class="p">,</span> <span class="n">positive</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">n</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;n&#39;</span><span class="p">,</span> <span class="n">negative</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Max</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="go">Max(-2, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Max</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Max</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="go">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Max</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>
<span class="go">Max(x, y)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Max</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span> <span class="o">==</span> <span class="n">Max</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Max</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">Max</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">z</span><span class="p">))</span>
<span class="go">Max(x, y, z)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Max</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="o">-</span><span class="n">oo</span><span class="p">)</span>
<span class="go">Max(8, p)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Max</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">oo</span><span class="p">)</span>
<span class="go">oo</span>
</pre></div>
</div>
<ul class="simple">
<li><p>Algorithm</p></li>
</ul>
<p>The task can be considered as searching of supremums in the
directed complete partial orders <a class="reference internal" href="#r280" id="id60"><span>[R280]</span></a>.</p>
<p>The source values are sequentially allocated by the isolated subsets
in which supremums are searched and result as Max arguments.</p>
<p>If the resulted supremum is single, then it is returned.</p>
<p>The isolated subsets are the sets of values which are only the comparable
with each other in the current set. E.g. natural numbers are comparable with
each other, but not comparable with the <span class="math notranslate nohighlight">\(x\)</span> symbol. Another example: the
symbol <span class="math notranslate nohighlight">\(x\)</span> with negative assumption is comparable with a natural number.</p>
<p>Also there are “least” elements, which are comparable with all others,
and have a zero property (maximum or minimum for all elements). E.g. <span class="math notranslate nohighlight">\(oo\)</span>.
In case of it the allocation operation is terminated and only this value is
returned.</p>
<dl class="simple">
<dt>Assumption:</dt><dd><ul class="simple">
<li><p>if A &gt; B &gt; C then A &gt; C</p></li>
<li><p>if A == B then B can be removed</p></li>
</ul>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.elementary.miscellaneous.Min" title="sympy.functions.elementary.miscellaneous.Min"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Min</span></code></a></dt><dd><p>find minimum values</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r280"><span class="brackets">R280</span><span class="fn-backref">(<a href="#id60">1</a>,<a href="#id61">2</a>)</span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Directed_complete_partial_order">https://en.wikipedia.org/wiki/Directed_complete_partial_order</a></p>
</dd>
<dt class="label" id="r281"><span class="brackets"><a class="fn-backref" href="#id62">R281</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Lattice_(order)">https://en.wikipedia.org/wiki/Lattice_%28order%29</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="root">
<h2>root<a class="headerlink" href="#root" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.functions.elementary.miscellaneous.root">
<span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.miscellaneous.</span></span><span class="sig-name descname"><span class="pre">root</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">evaluate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/miscellaneous.py#L212-L309"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.miscellaneous.root" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the <em>k</em>-th <em>n</em>-th root of <code class="docutils literal notranslate"><span class="pre">arg</span></code>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>k</strong> : int, optional</p>
<blockquote>
<div><p>Should be an integer in <span class="math notranslate nohighlight">\(\{0, 1, ..., n-1\}\)</span>.
Defaults to the principal root if <span class="math notranslate nohighlight">\(0\)</span>.</p>
</div></blockquote>
<p><strong>evaluate</strong> : bool, optional</p>
<blockquote>
<div><p>The parameter determines if the expression should be evaluated.
If <code class="docutils literal notranslate"><span class="pre">None</span></code>, its value is taken from
<code class="docutils literal notranslate"><span class="pre">global_parameters.evaluate</span></code>.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">root</span><span class="p">,</span> <span class="n">Rational</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">n</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">root</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">sqrt(x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">root</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">x**(1/3)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">root</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span>
<span class="go">x**(1/n)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">root</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="n">Rational</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span>
<span class="go">x**(-3/2)</span>
</pre></div>
</div>
<p>To get the k-th n-th root, specify k:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">root</span><span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">-(-1)**(2/3)*2**(1/3)</span>
</pre></div>
</div>
<p>To get all n n-th roots you can use the rootof function.
The following examples show the roots of unity for n
equal 2, 3 and 4:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">rootof</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="p">[</span><span class="n">rootof</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">2</span><span class="p">)]</span>
<span class="go">[-1, 1]</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="p">[</span><span class="n">rootof</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span><span class="n">i</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">3</span><span class="p">)]</span>
<span class="go">[1, -1/2 - sqrt(3)*I/2, -1/2 + sqrt(3)*I/2]</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="p">[</span><span class="n">rootof</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">4</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span><span class="n">i</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">4</span><span class="p">)]</span>
<span class="go">[-1, 1, -I, I]</span>
</pre></div>
</div>
<p>SymPy, like other symbolic algebra systems, returns the
complex root of negative numbers. This is the principal
root and differs from the text-book result that one might
be expecting. For example, the cube root of -8 does not
come back as -2:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">root</span><span class="p">(</span><span class="o">-</span><span class="mi">8</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">2*(-1)**(1/3)</span>
</pre></div>
</div>
<p>The real_root function can be used to either make the principal
result real (or simply to return the real root directly):</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">real_root</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">real_root</span><span class="p">(</span><span class="n">_</span><span class="p">)</span>
<span class="go">-2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">real_root</span><span class="p">(</span><span class="o">-</span><span class="mi">32</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="go">-2</span>
</pre></div>
</div>
<p>Alternatively, the n//2-th n-th root of a negative number can be
computed with root:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">root</span><span class="p">(</span><span class="o">-</span><span class="mi">32</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="o">//</span><span class="mi">2</span><span class="p">)</span>
<span class="go">-2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="../polys/reference.html#sympy.polys.rootoftools.rootof" title="sympy.polys.rootoftools.rootof"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.rootoftools.rootof</span></code></a>, <a class="reference internal" href="../core.html#sympy.core.power.integer_nthroot" title="sympy.core.power.integer_nthroot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.core.power.integer_nthroot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.miscellaneous.sqrt" title="sympy.functions.elementary.miscellaneous.sqrt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sqrt</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.miscellaneous.real_root" title="sympy.functions.elementary.miscellaneous.real_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">real_root</span></code></a></p>
</div>
<p class="rubric">References</p>
<ul class="simple">
<li><p><a class="reference external" href="https://en.wikipedia.org/wiki/Square_root">https://en.wikipedia.org/wiki/Square_root</a></p></li>
<li><p><a class="reference external" href="https://en.wikipedia.org/wiki/Real_root">https://en.wikipedia.org/wiki/Real_root</a></p></li>
<li><p><a class="reference external" href="https://en.wikipedia.org/wiki/Root_of_unity">https://en.wikipedia.org/wiki/Root_of_unity</a></p></li>
<li><p><a class="reference external" href="https://en.wikipedia.org/wiki/Principal_value">https://en.wikipedia.org/wiki/Principal_value</a></p></li>
<li><p><a class="reference external" href="http://mathworld.wolfram.com/CubeRoot.html">http://mathworld.wolfram.com/CubeRoot.html</a></p></li>
</ul>
</dd></dl>

</section>
<section id="sqrt">
<h2>sqrt<a class="headerlink" href="#sqrt" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.functions.elementary.miscellaneous.sqrt">
<span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.miscellaneous.</span></span><span class="sig-name descname"><span class="pre">sqrt</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">evaluate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/miscellaneous.py#L65-L152"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.miscellaneous.sqrt" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the principal square root.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>evaluate</strong> : bool, optional</p>
<blockquote>
<div><p>The parameter determines if the expression should be evaluated.
If <code class="docutils literal notranslate"><span class="pre">None</span></code>, its value is taken from
<code class="docutils literal notranslate"><span class="pre">global_parameters.evaluate</span></code>.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sqrt</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">sqrt</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">sqrt(x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">sqrt</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span>
<span class="go">x</span>
</pre></div>
</div>
<p>Note that sqrt(x**2) does not simplify to x.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">sqrt</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="go">sqrt(x**2)</span>
</pre></div>
</div>
<p>This is because the two are not equal to each other in general.
For example, consider x == -1:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Eq</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Eq</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">False</span>
</pre></div>
</div>
<p>This is because sqrt computes the principal square root, so the square may
put the argument in a different branch.  This identity does hold if x is
positive:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;y&#39;</span><span class="p">,</span> <span class="n">positive</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sqrt</span><span class="p">(</span><span class="n">y</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="go">y</span>
</pre></div>
</div>
<p>You can force this simplification by using the powdenest() function with
the force option set to True:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">powdenest</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sqrt</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="go">sqrt(x**2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">powdenest</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">),</span> <span class="n">force</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">x</span>
</pre></div>
</div>
<p>To get both branches of the square root you can use the rootof function:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">rootof</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="p">[</span><span class="n">rootof</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">-</span><span class="mi">3</span><span class="p">,</span><span class="n">i</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">)]</span>
<span class="go">[-sqrt(3), sqrt(3)]</span>
</pre></div>
</div>
<p>Although <code class="docutils literal notranslate"><span class="pre">sqrt</span></code> is printed, there is no <code class="docutils literal notranslate"><span class="pre">sqrt</span></code> function so looking for
<code class="docutils literal notranslate"><span class="pre">sqrt</span></code> in an expression will fail:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.utilities.misc</span> <span class="kn">import</span> <span class="n">func_name</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">func_name</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="go">&#39;Pow&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sqrt</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">has</span><span class="p">(</span><span class="n">sqrt</span><span class="p">)</span>
<span class="gt">Traceback (most recent call last):</span>
  <span class="c">...</span>
<span class="gr">sympy.core.sympify.SympifyError</span>: <span class="n">SympifyError: &lt;function sqrt at 0x10e8900d0&gt;</span>
</pre></div>
</div>
<p>To find <code class="docutils literal notranslate"><span class="pre">sqrt</span></code> look for <code class="docutils literal notranslate"><span class="pre">Pow</span></code> with an exponent of <code class="docutils literal notranslate"><span class="pre">1/2</span></code>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="o">/</span><span class="n">sqrt</span><span class="p">(</span><span class="n">x</span><span class="p">))</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="k">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span><span class="o">.</span><span class="n">is_Pow</span> <span class="ow">and</span> <span class="nb">abs</span><span class="p">(</span><span class="n">i</span><span class="o">.</span><span class="n">exp</span><span class="p">)</span> <span class="ow">is</span> <span class="n">S</span><span class="o">.</span><span class="n">Half</span><span class="p">)</span>
<span class="go">{1/sqrt(x)}</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="../polys/reference.html#sympy.polys.rootoftools.rootof" title="sympy.polys.rootoftools.rootof"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.rootoftools.rootof</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.miscellaneous.root" title="sympy.functions.elementary.miscellaneous.root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">root</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.miscellaneous.real_root" title="sympy.functions.elementary.miscellaneous.real_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">real_root</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r282"><span class="brackets"><a class="fn-backref" href="#id63">R282</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Square_root">https://en.wikipedia.org/wiki/Square_root</a></p>
</dd>
<dt class="label" id="r283"><span class="brackets"><a class="fn-backref" href="#id64">R283</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Principal_value">https://en.wikipedia.org/wiki/Principal_value</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="cbrt">
<h2>cbrt<a class="headerlink" href="#cbrt" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.functions.elementary.miscellaneous.cbrt">
<span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.miscellaneous.</span></span><span class="sig-name descname"><span class="pre">cbrt</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">evaluate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/miscellaneous.py#L155-L209"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.miscellaneous.cbrt" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the principal cube root.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>evaluate</strong> : bool, optional</p>
<blockquote>
<div><p>The parameter determines if the expression should be evaluated.
If <code class="docutils literal notranslate"><span class="pre">None</span></code>, its value is taken from
<code class="docutils literal notranslate"><span class="pre">global_parameters.evaluate</span></code>.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">cbrt</span><span class="p">,</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">cbrt</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">x**(1/3)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">cbrt</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">3</span>
<span class="go">x</span>
</pre></div>
</div>
<p>Note that cbrt(x**3) does not simplify to x.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">cbrt</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">3</span><span class="p">)</span>
<span class="go">(x**3)**(1/3)</span>
</pre></div>
</div>
<p>This is because the two are not equal to each other in general.
For example, consider <span class="math notranslate nohighlight">\(x == -1\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Eq</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Eq</span><span class="p">(</span><span class="n">cbrt</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">3</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">False</span>
</pre></div>
</div>
<p>This is because cbrt computes the principal cube root, this
identity does hold if <span class="math notranslate nohighlight">\(x\)</span> is positive:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;y&#39;</span><span class="p">,</span> <span class="n">positive</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cbrt</span><span class="p">(</span><span class="n">y</span><span class="o">**</span><span class="mi">3</span><span class="p">)</span>
<span class="go">y</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="../polys/reference.html#sympy.polys.rootoftools.rootof" title="sympy.polys.rootoftools.rootof"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.rootoftools.rootof</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.miscellaneous.root" title="sympy.functions.elementary.miscellaneous.root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">root</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.miscellaneous.real_root" title="sympy.functions.elementary.miscellaneous.real_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">real_root</span></code></a></p>
</div>
<p class="rubric">References</p>
<ul class="simple">
<li><p><a class="reference external" href="https://en.wikipedia.org/wiki/Cube_root">https://en.wikipedia.org/wiki/Cube_root</a></p></li>
<li><p><a class="reference external" href="https://en.wikipedia.org/wiki/Principal_value">https://en.wikipedia.org/wiki/Principal_value</a></p></li>
</ul>
</dd></dl>

</section>
<section id="real-root">
<h2>real_root<a class="headerlink" href="#real-root" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.functions.elementary.miscellaneous.real_root">
<span class="sig-prename descclassname"><span class="pre">sympy.functions.elementary.miscellaneous.</span></span><span class="sig-name descname"><span class="pre">real_root</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">evaluate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/elementary/miscellaneous.py#L312-L372"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.elementary.miscellaneous.real_root" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the real <em>n</em>’th-root of <em>arg</em> if possible.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n</strong> : int or None, optional</p>
<blockquote>
<div><p>If <em>n</em> is <code class="docutils literal notranslate"><span class="pre">None</span></code>, then all instances of
<code class="docutils literal notranslate"><span class="pre">(-n)**(1/odd)</span></code> will be changed to <code class="docutils literal notranslate"><span class="pre">-n**(1/odd)</span></code>.
This will only create a real root of a principal root.
The presence of other factors may cause the result to not be
real.</p>
</div></blockquote>
<p><strong>evaluate</strong> : bool, optional</p>
<blockquote>
<div><p>The parameter determines if the expression should be evaluated.
If <code class="docutils literal notranslate"><span class="pre">None</span></code>, its value is taken from
<code class="docutils literal notranslate"><span class="pre">global_parameters.evaluate</span></code>.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">root</span><span class="p">,</span> <span class="n">real_root</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">real_root</span><span class="p">(</span><span class="o">-</span><span class="mi">8</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">-2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">root</span><span class="p">(</span><span class="o">-</span><span class="mi">8</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">2*(-1)**(1/3)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">real_root</span><span class="p">(</span><span class="n">_</span><span class="p">)</span>
<span class="go">-2</span>
</pre></div>
</div>
<p>If one creates a non-principal root and applies real_root, the
result will not be real (so use with caution):</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">root</span><span class="p">(</span><span class="o">-</span><span class="mi">8</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">-2*(-1)**(2/3)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">real_root</span><span class="p">(</span><span class="n">_</span><span class="p">)</span>
<span class="go">-2*(-1)**(2/3)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="../polys/reference.html#sympy.polys.rootoftools.rootof" title="sympy.polys.rootoftools.rootof"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.rootoftools.rootof</span></code></a>, <a class="reference internal" href="../core.html#sympy.core.power.integer_nthroot" title="sympy.core.power.integer_nthroot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.core.power.integer_nthroot</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.miscellaneous.root" title="sympy.functions.elementary.miscellaneous.root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">root</span></code></a>, <a class="reference internal" href="#sympy.functions.elementary.miscellaneous.sqrt" title="sympy.functions.elementary.miscellaneous.sqrt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sqrt</span></code></a></p>
</div>
</dd></dl>

</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Elementary</a></li>
<li><a class="reference internal" href="#sympy-functions-elementary-complexes">sympy.functions.elementary.complexes</a><ul>
<li><a class="reference internal" href="#re">re</a></li>
<li><a class="reference internal" href="#im">im</a></li>
<li><a class="reference internal" href="#sign">sign</a></li>
<li><a class="reference internal" href="#abs">Abs</a></li>
<li><a class="reference internal" href="#arg">arg</a></li>
<li><a class="reference internal" href="#conjugate">conjugate</a></li>
<li><a class="reference internal" href="#polar-lift">polar_lift</a></li>
<li><a class="reference internal" href="#periodic-argument">periodic_argument</a></li>
<li><a class="reference internal" href="#principal-branch">principal_branch</a></li>
</ul>
</li>
<li><a class="reference internal" href="#sympy-functions-elementary-trigonometric">sympy.functions.elementary.trigonometric</a></li>
<li><a class="reference internal" href="#trigonometric-functions">Trigonometric Functions</a><ul>
<li><a class="reference internal" href="#sin">sin</a></li>
<li><a class="reference internal" href="#cos">cos</a></li>
<li><a class="reference internal" href="#tan">tan</a></li>
<li><a class="reference internal" href="#cot">cot</a></li>
<li><a class="reference internal" href="#sec">sec</a></li>
<li><a class="reference internal" href="#csc">csc</a></li>
<li><a class="reference internal" href="#sinc">sinc</a></li>
</ul>
</li>
<li><a class="reference internal" href="#trigonometric-inverses">Trigonometric Inverses</a><ul>
<li><a class="reference internal" href="#asin">asin</a></li>
<li><a class="reference internal" href="#acos">acos</a></li>
<li><a class="reference internal" href="#atan">atan</a></li>
<li><a class="reference internal" href="#acot">acot</a></li>
<li><a class="reference internal" href="#asec">asec</a></li>
<li><a class="reference internal" href="#acsc">acsc</a></li>
<li><a class="reference internal" href="#atan2">atan2</a></li>
</ul>
</li>
<li><a class="reference internal" href="#sympy-functions-elementary-hyperbolic">sympy.functions.elementary.hyperbolic</a></li>
<li><a class="reference internal" href="#hyperbolic-functions">Hyperbolic Functions</a><ul>
<li><a class="reference internal" href="#hyperbolicfunction">HyperbolicFunction</a></li>
<li><a class="reference internal" href="#sinh">sinh</a></li>
<li><a class="reference internal" href="#cosh">cosh</a></li>
<li><a class="reference internal" href="#tanh">tanh</a></li>
<li><a class="reference internal" href="#coth">coth</a></li>
<li><a class="reference internal" href="#sech">sech</a></li>
<li><a class="reference internal" href="#csch">csch</a></li>
</ul>
</li>
<li><a class="reference internal" href="#hyperbolic-inverses">Hyperbolic Inverses</a><ul>
<li><a class="reference internal" href="#asinh">asinh</a></li>
<li><a class="reference internal" href="#acosh">acosh</a></li>
<li><a class="reference internal" href="#atanh">atanh</a></li>
<li><a class="reference internal" href="#acoth">acoth</a></li>
<li><a class="reference internal" href="#asech">asech</a></li>
<li><a class="reference internal" href="#acsch">acsch</a></li>
</ul>
</li>
<li><a class="reference internal" href="#sympy-functions-elementary-integers">sympy.functions.elementary.integers</a><ul>
<li><a class="reference internal" href="#ceiling">ceiling</a></li>
<li><a class="reference internal" href="#floor">floor</a></li>
<li><a class="reference internal" href="#roundfunction">RoundFunction</a></li>
<li><a class="reference internal" href="#frac">frac</a></li>
</ul>
</li>
<li><a class="reference internal" href="#sympy-functions-elementary-exponential">sympy.functions.elementary.exponential</a><ul>
<li><a class="reference internal" href="#exp">exp</a></li>
<li><a class="reference internal" href="#lambertw">LambertW</a></li>
<li><a class="reference internal" href="#log">log</a></li>
<li><a class="reference internal" href="#exp-polar">exp_polar</a></li>
</ul>
</li>
<li><a class="reference internal" href="#sympy-functions-elementary-piecewise">sympy.functions.elementary.piecewise</a><ul>
<li><a class="reference internal" href="#exprcondpair">ExprCondPair</a></li>
<li><a class="reference internal" href="#piecewise">Piecewise</a></li>
</ul>
</li>
<li><a class="reference internal" href="#sympy-functions-elementary-miscellaneous">sympy.functions.elementary.miscellaneous</a><ul>
<li><a class="reference internal" href="#identityfunction">IdentityFunction</a></li>
<li><a class="reference internal" href="#min">Min</a></li>
<li><a class="reference internal" href="#max">Max</a></li>
<li><a class="reference internal" href="#root">root</a></li>
<li><a class="reference internal" href="#sqrt">sqrt</a></li>
<li><a class="reference internal" href="#cbrt">cbrt</a></li>
<li><a class="reference internal" href="#real-root">real_root</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="index.html"
                        title="previous chapter">Functions</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="combinatorial.html"
                        title="next chapter">Combinatorial</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/modules/functions/elementary.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="combinatorial.html" title="Combinatorial"
             >next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Functions"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" >Functions</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Elementary</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/functions/elementary.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:28:17 GMT -->
</html>